Setting assignment group of task within worklow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 07:18 AM
Hello,
I'm facing quite unusual situation. I have Catalog Task activity on my workflow that states following in the script:
var siteValue = current.variables.site.toString();
var VMlocation = current.variables.vm.location.country.name.toString();
if (current.variables.region == 'apac' && siteValue == 'CN' || VMlocation == "China") {
task.assignment_group.setDisplayValue("Group A");
} else {
task.assignment_group.setDisplayValue("Group B");
}
What happens is that when me as an admin raise a request - assignment group setting works fine. However, when a generic 'end-user' places the request - assignment group shows empty. Does anyone know what could be a problem here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 07:21 AM
Hi @Dawid2 ,
Please pick the catalog task activity from the workflow activities as shown below:
And in the fullfillment group you can mention your assignment group
var gr = new GlideRecord("sc_task");
gr.addQuery("request_item", current.sys_id);
gr.query();
if (gr.next()) {
gr.assignment_group = "SYS_ID_OF_GROUP";
gr.update;
}
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 08:05 AM
Thanks for this but this doesn't solve my problem, assignment group should be set dynamically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 08:25 AM
Hi @Dawid2 ,
Please check one condition opened by user, check whether the user is admin or not in the script, then it may be works
Thanks
Arun
Please mark helpful,If the solution is fine.