
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2018 07:03 AM
I am wondering if you can write a script inside of the task to assign that task to a specific assignment group based on the value of a variable.
Inside of the workflow - I have a task and I have some script inside of that task because I want the task to go to a specific group based off the value of a variable. The script that I have inside doesn't seem to be working at all. Not exactly sure why?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2018 07:58 AM
As this activity is Catalog Task and your sample code looks like the code to generate Approvals I guess you used wrong syntax for setting the group in Catalog Task activity. If you check "advanced" in Catalog Task, you have a script field that allows you to set any field of task being generated. This is the template I get:
// Set values for the task in this script. Use the variable 'task' when setting additional values.
// Note: This script is run after the task values are set using the Fields, Template or Values you have specified.
//
// For example:
// task.short_description = current.short_description;
so you should put in your if/else statements "task.assignment_group = 'sys_id'" instead of pushing into answer array (which is syntax from Approval activities).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2018 07:58 AM
As this activity is Catalog Task and your sample code looks like the code to generate Approvals I guess you used wrong syntax for setting the group in Catalog Task activity. If you check "advanced" in Catalog Task, you have a script field that allows you to set any field of task being generated. This is the template I get:
// Set values for the task in this script. Use the variable 'task' when setting additional values.
// Note: This script is run after the task values are set using the Fields, Template or Values you have specified.
//
// For example:
// task.short_description = current.short_description;
so you should put in your if/else statements "task.assignment_group = 'sys_id'" instead of pushing into answer array (which is syntax from Approval activities).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2018 11:18 AM
Thank you Dominic.
Much appreciated