- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2020 10:13 AM
Hi All,
I want to set the assignment group in request form as per the task's assignment group which is generated within it.
kindly suggest on this.
in advance thanks.
Thanks,
Shrinivasprasad
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2020 08:35 AM
Hi,
the above script should work; did you try adding logs and check
Can you share the script you are using in catalog task activity script section
var record = new GlideRecord('sc_request');
record.addQuery('sys_id', current.request);
record.query();
if(record.next()){
gs.info('Inside Record');
record.assignment_group = task.assignment_group;
record.update();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 06:42 AM
In the workflow on the catalog task activity, you can add an advanced script like this
var req = new GlideRecord('sc_request');
req.addQuery('sys_id', current.request);
req.query();
if(req.next()){
req.assignment_group = task.assignment_group;
req.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 08:16 AM
There have only been 2 so far - we need a couple of more people to post the same correct answer after the first one (mine), just to re-enforce it I guess. Or submit a wrong answer, then you can edit it later to change it to the right one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 08:59 AM
Hi Srini,
Is this requirement is specific to a catalog item?
You can write an after update Business rule on Task table and by hitting a Glide record on the Request table you can update the Assignement group.
But,it really depends on the catalog task you want to perform this update for. As a part of your process there might be multiple catalog tasks? Can you please elaborate your requirement more so that I can help further
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 10:22 AM
Hi Kalyani,
yes, this requirement is specific to a catalog item.
when we raise the request the assignment group is displaying in the tasks form, there are two tasks that will generate within the RITM, I want to set the assignment group of the first task to REQ form.
Thanks in advance.
Thanks,
Shrinivasprasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 08:59 PM
Hi,
Did you check the script mentioned previously.
posting it again
var record = new GlideRecord('sc_request');
record.addQuery('sys_id', current.request);
record.query();
if(record.next()){
record.assignment_group = task.assignment_group;
record.update();
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader