- 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-01-2015 10:33 PM
Hi Ramya,
You can write the below script on Business rule. Please modify as per your requirement.
getRec();
function getRec()
{
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item',current.sys_id);
gr.query();
while(gr.next())
{
gs.addInfoMessage(gr.number);
}
}
NOTE: If you are using the before BR then don't use "current.update" in the BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2015 11:00 PM
function getRec()
{
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item',current.sys_id);
gr.query();
while(gr.next())
{
// gs.addInfoMessage(gr.number);
gs.log(gr.number);
}
}
-------------------------
this one is in the final task of the RITM in the workflow's advanced script//
the log statement prints only the first task number and not the rest//

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2015 11:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2015 11:48 PM
this code works (y)
but if i have two tasks under one RITM..
RITM
-task0001
-task0002
and if the code is in the advanced script of the 2nd task's activity in the workflow, it logs only the task0001 and not task0002,
so what do i do to log the task0002 from task0002's workflow advanced script..?