Task assignment - Catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 12:48 AM
Hi all,
I have a rquirement that the generated task for a catalog item should be assigned to the respective assignment group based on the choice selection in the generic workflow.
I have chosen to rite script in the catalog mapping section of the catalog item. But it's not working as expected.could anyone help me.
Choices and it's values are 1.A - aa , 2. B -bb 3. C - cc
Assignment group A grp, B grp and C grp
My code:
var choice = current.variables.choices;
if(choice == 'A'){
task.assignment_group = 'sys_id of the group';}like for B and C as well.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 12:57 AM
Hi,
are you sure variable name and choice value is correct?
I believe it should be like this i.e. you should compare with aa, bb, cc since you mentioned that's the choice value
var choice = current.variables.choices;
if(choice == 'aa')
task.assignment_group = 'sys_id of the group1';
else if(choice == 'bb')
task.assignment_group = 'sys_id of the group2';
else if(choice == 'cc')
task.assignment_group = 'sys_id of the group3';
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
07-29-2022 11:30 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader