- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2015 10:16 PM
Hi All,
Could you please help me to get all the task numbers generated under an RITM and check for a particualar assignment group for that task..
RITMxxxx
-TASKxxx1
-TASKxxx2
-TASKxxx3
How do i get this with the RITM's sys_id..
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2015 01:20 AM
Hi Ramya,
Add new activity to your workflow - "Run Script" after finishing the the Task Creation.
And in the "Script" part of run script add the code as:
function getRec()
{
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item',current.sys_id);
gr.query();
while(gr.next())
{
gs.log(gr.number);
}
}
you will get all the tasks related to current RITM.
Thanks,
Ganesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2015 12:33 AM
Hi Ramya,
You can use the "Run Script" utility after the second task in the workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2015 01:20 AM
Hi Ramya,
Add new activity to your workflow - "Run Script" after finishing the the Task Creation.
And in the "Script" part of run script add the code as:
function getRec()
{
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item',current.sys_id);
gr.query();
while(gr.next())
{
gs.log(gr.number);
}
}
you will get all the tasks related to current RITM.
Thanks,
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2015 05:14 AM
Please mark the discussion as Answered , if you feel so..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 08:20 AM
Hello - This is a question out side of this thread... In your screen shot I see the error of basic authentication failed where you able to check this error or any fix ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 08:02 AM
Hello - I had quick question on the same note the above logic helps you retrieve all the tasks under the RITM but in the same logic how can we drill down to one Task with certain conditions. I know I can add another addQuery to write the short description but I dont want my code to have some text which can be modified from the front end and hampers the workflow...
var gr_tsk = new GlideRecord("sc_task");
gr_tsk.addQuery('request_item', current.sys_id);
gr_tsk.addQuery('short_description', 'Task for IAM'); // Out of 10 or 100 tasks the RITM has I can identify the one i want by using short description but I want to know if there is a better way to identify each task under the RITM uniquely
gr_tsk.query();
if(gr_tsk.next())
{
return yes;
}
return no;