How to dot walk from requested item form to catalog task related list field?

johannes5
Giga Expert

Hi ServiceNow Community Developers,        

I have the following situation - I have a Requested Item form (sc_req_item table) that has catalog task (sc_task table) related list. When the work notes changes in the Requested Item form I need to send a notification to the assignment group that is in the catalog tasks related list. Would you please advise as to how do I dot walk from the sc_req_item table to the sc_task table to pick up the assignment group that is in this table and specify that as the group i want emails to be sent to. . I can see the 'Show related fields' link but I cannot tell which field to choose that will let me dot walk to the assignment group that is defined in the catalog task (sc_task) table. Please help.    


Thanks,

Johannes

1 ACCEPTED SOLUTION

you can only dot walk from a child to a parent...   which is why this didn't work...



how to get the additional recipients isn't to hard.. write a mail notification script that looks up the people that have tasks assigned to them with that item as a parent then use "email.addAddress("cc",splitThis[i]);"   to add the user to the email <put the user in where i have splitThis   array>


View solution in original post

16 REPLIES 16

In the case if you need to get the users involved in [sc_task] under a [sc_req_item],



1/ Query - Get the list of tasks that points to the request and add it to a String str_groups


2/ Query - get the users that are under str_groups.


var gr = new GlideRecord('sys_user_grmember');


gr.addQuery('group','IN',str_groups)


In my opinion, the best is to do what Doug Said to you in the previous comment:



- BR to copy the data written in the RITM to any active child [sc_task] (Because Closed ones are not intended to be affected by any action on the RITM)


- Notification at [sc_task] table to send an email when new data comes to the [sc_task],


        - (managed through an event in order to set a complex conditions BR: gs.eventQueue('event', current, ...) )


        - Recipient: user/group in fields: Assignment_group field


randrews
Tera Guru

what we did for this requirement was a BR that copies the work notes from the item to it's children tasks when they are changed... this triggered the email we already had setup for the tasks for task updated.


Kalaiarasan Pus
Giga Sage

If Doug's suggestion does not workout , let us know His suggestion is far easier and makes use of the notification you may have already


it also lets the techs work from the task only without having to keep going back to the item.. which is big for the fulfillment groups and why we did it this way!!