Viewing related items on a catalog task

germc
Giga Expert

Hi guys,

Im looking to see if there is a way to view the Request Items from a Service Catalogue Request on the individual Tasks.

These can be viewed on the actual 'Request' (printscreen below) but it would be great to be able to view these on the Tasks further down the chain.

This would be needed so that when a few tasks under the same request is logged to the same team, the analysts that picks up the first one can view if there are any other related tasks too.

I hope Im making sense. Is this possible?


1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi,



Go to system definition->relationship


Applies to table:catalog task[sc_task]


Queries from :Requested item[sc_req_item]


Script:


current.addQuery('request', parent.request_item.request);



Please let me know the outcome.



Thanks,


Pradeep Sharma


View solution in original post

15 REPLIES 15

Hi Bert,


I presume you are trying to display all the related request items on the Tasks?


If so, the following query will do it: current.addQuery('request', parent.request_item.request);


Also screenshot:


RITM.PNG


bert_c
ServiceNow Employee
ServiceNow Employee

Hello Gerald,



Thank you for responding.   I asked the wrong question, I do have that Relationship defined as you show, and that part of the report seems to be working.   What I meant to ask about is having the parent Request shown for the requested items, in addition to the related request items on a Task, on this report.   I am hoping an additional Relationship where the "Applies to table" would be sc_req_item and the "Queries from table would be sc_request would do it.   It is not apparent to me what field in sc_req_item maps to a field in sc_request.



Thank you.


Hi Bert,


Apologies, so you are looking to view the Request Number on each of the corresponding RITM's.


Try this query:


current.addQuery('number', parent.request.number);


bert_c
ServiceNow Employee
ServiceNow Employee

Hello Gerald,


That didn't help. The strange thing is the report with either query (and I believe before I tried defining a second relationship that we are discussing) does show related Requests for many RITMs and TASKs row combinations but not others.   And if I click on a RITM (where the Request column is empty) I do see it has a Request value.   A snap shot is below with some of the entries where the Request is not being included, but further down in the report the Request column has correct values.   I have the Relationship (sc_req_item -> sc_task) from the original post, and a new Relationship (sc_req_item -> sc_request) to try to address this.   I do see sc_req_item has a field named "Request" that is a Reference to the sc_request table, so I am hoping this approach of defining Relationships will produce the desired results for the report.   Thank you for any insight.Screen Shot 2015-03-30 at 10.07.05 AM.JPG



Hi Bert,


I did not realise you were doing this through a report.


The relationships I was defining can be viewed on the actual Request Item by adding the new view as a tab at the bottom of the RITM:


RITM view.PNG



If you are just trying to view on a report, you just dot walk to theRequest Number. So in the 'available' field on the report click on 'Request Item' then 'Request' and add that to the 'selected'. You will then see the Request Number.


I have something similar:



test1.png