- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 12:38 AM
Hello Experts,
I have list collector variable (assignment_group) on catalog item form referencing to a custom table and all those groups are present in sys_user_group table, I want to trigger catalog tasks to any group selected on catalog item variable while raising a request. If one group is selected then one catalog task should tigger to that particular assignment group. If multiple groups are selected that multiple catalog task should trigger to those assignment groups.
Please advice how can I achieve this.
Script in the catalog task activity:
With the above script am able to create only one catalog task getting assigned to last assignment group in the array. remaining are groups are ignored.
Please help me to achieve this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 04:13 AM
Yes the tasks needed to be created parallelly.
i used the run script activity to achieve this scenario and it worked.
Here is the modified script:
task.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:54 AM
VERY important detail here: Do you expect all these Tasks to be "in parallel", and must all of them finish in order to move to the next part of the workflow?
Also, scripting this isn't a good idea because the script created sc_tasks aren't REALLY part of the flow at that point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 04:13 AM
Yes the tasks needed to be created parallelly.
i used the run script activity to achieve this scenario and it worked.
Here is the modified script:
task.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 04:08 AM
@Community Alums
why are you creating catalog task via script?
you might be using either Workflow or flow designer.
Why not add logic in that itself?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 04:15 AM
i have added the logic in catalog task activity itself but it was throwing a warning of data policy exception.
Later removed the catalog task activity and used run script activity it worked.
thanks for the quick response.