2

I am working on a site collection of type Team Site inside SharePoint server 2013. and i have the following :-

  1. The site collection have 10 sub-sites.

  2. all the 10 sub-sites were created using the same site template.

  3. and each subsite have 2 lists (2 issue tracking lists).

Now I want inside the site collection’s home page to show a general list that display the following info:-

All the items from all the sub sites’ lists that have "Pending" status & are "Assign-To" the login user.

Now I read about the available options insides SharePoint and I settled on using the content search web part. So i did the following; from the site collection home page>>I edit the page>> I add a content search web part, and I define the following ( Mainly to retrieve only items + under the site collection URL + under the specified list id. but I did not get any result as follow:-

enter image description here

Now I have these questions:-

  1. How I can force the above query to show the items from multiple lists IDs since i will have 20 lists (10 subsites X 2 lists)?

  2. How I can filter the items to show only the items that have their Status = Pending and their Assign-To = ME (the login user)??

2

Apart form restricting the Path to current site collection, you need to specify STS_List_IssueTrackingto get items from Issue Tracking lists only. Moreover, you need to check the managed properties available for Status and Assigned To fields in the Search settings and then use them in the search query. Example:

Status:Pending AND AssignedTo:{User.Name}
  • thanks for the reply so you mean i need to use STS_List_IssueTracking instead of the listIds ? – john Gu Nov 6 '15 at 12:41
  • STS_List_IssueTracking will get data from all Issue Tracking lists. No need to specify them one by one using ListID – Nadeem Yousuf Nov 6 '15 at 13:01
  • i tried the following "path:"servername/ParentsubsiteURL" IsDocument:"True" " and i got results from all the subsites under the specifed URL , now i add extra filter as follow "path:"servername/ParentsubsiteURL" IsDocument:"True" contentclass:"STS_ListItem_IssueTracking" " ,, but this did not return any results , i was expecting that this will show only Issue tracking items ,, can u adivce what could be causing this ? – john Gu Nov 6 '15 at 13:05
  • 1
    Try removing IsDocument:"True". Are you looking for list items or documents? – Nadeem Yousuf Nov 6 '15 at 13:06
  • @Nadeen you are correct .I specify the following "path:"URL/Sites" IsDocument:"False" contentclass:"STS_ListItem_IssueTracking" it showed me all the items inside the issue tracking lists, now my real column name is "Risk/Issue status" and not just status . so i wrote the following "path:"URL/Sites" IsDocument:"False" contentclass:"STS_ListItem_IssueTracking" Risk/Issue status:Pending" but i did not get any result .. i think the problem is related to referencing the "Risk/Issue status" should i use its display name or internal name ? and should this be encoded ? – john Gu Nov 6 '15 at 13:23
2

First of all you put only path in your query so that you get any results. If you get results your search is running ok.

path:"http://YOURSITE"

After that you go to desire list/s and click List Settings, copy listID from url and decode it from 1aaaaaaa%2Daaaa... format to format with "-" 1aaaaaaa-aaaa...

http://meyerweb.com/eric/tools/dencoder/ - paste id and click decode

After that write in query ListID: contains not ListID= equal

path:"http://YOURSITE"
(IsDocument:"True" OR contentclass:"STS_ListItem")
( ListID:1aaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa )

For more lists put OR in query

path:"http://YOURSITE"
(IsDocument:"True" OR contentclass:"STS_ListItem")
( ListID:1aaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa )
OR
( ListID:2aaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa )
OR
( ListID:... )

If you want all lists from content class IssueTracking (https://social.technet.microsoft.com/Forums/sharepoint/en-US/9f87d5d7-08bf-442d-ad3f-91036d164954/content-class-identifier-stslist) and filter to show only items that have Status=Pending and AssignTo=CurrentUser then your query will look like this:

path:"http://YOURSITE"   
contentclass:"STS_ListItem_IssueTracking"
Status:Pending AND AssignedTo:{User.Name}

If Status:Pending don't return anything, try with StatusOWSCHCS:Pending or if you add custom column add that managed property.

EDIT

Look in Managed Properties and find that new column

http://YOURSITE/_layouts/15/listmanagedproperties.aspx?level=sitecol

Something like RiskIssueStatusOWSCHCS and add that in query

  • thanks a lot for the great reply. now not sure what does content class means ? is it the same as content type? as in my case i am using custom CT which have their parent as the built-in Issue content type. now i try this "path:"YOURSITE" IsDocument:"True" " and it showed me all item inside my subsite, but when i added the following "contentclass:"STS_ListItem_IssueTracking" Status:Pending AND AssignedTo:{User.Name}" i did nto get any result ? can you adivce please ? – john Gu Nov 6 '15 at 12:52
  • try without --> Status:Pending AND AssignedTo:{User.Name} – Marko Tica Nov 6 '15 at 12:56
  • 1
    list of all contentclass > social.technet.microsoft.com/Forums/sharepoint/en-US/… – Marko Tica Nov 6 '15 at 12:58
  • i tried without using "status:Pending AND AssignedTo:{User.Name} " as follow "path:"YOURSITE" IsDocument:"True" contentclass:"STS_ListItem_IssueTracking"" but i did not get any result !! – john Gu Nov 6 '15 at 13:00
  • try without contentclass:"STS_ListItem_IssueTracking" and add ListID:aaa... and see if this would return items from that list – Marko Tica Nov 6 '15 at 13:07
0

I would recommend creating a new result source using the content type for the selection of the content to be searched and check to make sure it is returning results from the lists you want. Only then move on to the filtering in the query.

To filter by properties of a column you will need to ensure that the column is mapped to a managed property within the search schema.

https://technet.microsoft.com/en-us/library/jj219630.aspx

I would suggest focusing on the Assigned to field first as you will note from the above that it is automatically assigned as a managed property.

Then when that is working to filter content properly move on to the Risk/Issue status column which will need to be mapped in the schema before it can be used in the query. Assistance from MS below.

https://technet.microsoft.com/en-us/library/jj219667.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.