- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 11:22 AM
I'm trying to populate the assigned to task based on assignment group manager and other custom fields.
For example, I put that group on the catalog task assigned group field:
And this is my actual code, but I'm getting several errors when the workflow executes:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 11:36 AM
You cannot reference in the script the value set in the Fulfillment group field, so clear that field, then your script would look more like:
var group_sysid = '123123jk2j390213121234'; //sys_id of Assignment group
task.assignment_group = group_sysid;
var grp = new GlideRecord('sys_user_group');
if (grp.get(group_sysid)) {
task.assigned_to = grp.manager;
}
If you want to script the assignment of the Instructions field, use
task.description =
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 11:36 AM
You cannot reference in the script the value set in the Fulfillment group field, so clear that field, then your script would look more like:
var group_sysid = '123123jk2j390213121234'; //sys_id of Assignment group
task.assignment_group = group_sysid;
var grp = new GlideRecord('sys_user_group');
if (grp.get(group_sysid)) {
task.assigned_to = grp.manager;
}
If you want to script the assignment of the Instructions field, use
task.description =
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 11:41 AM
Thank you, it's working now