- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2020 12:08 PM
I have an catalog item with various variables.
Two of them are pulldowns of people in specific user groups.
Let's call the first pulldown variable: user1 (user1 is in a group called "FirstGroup")
Let's call the second pulldown variable user2. (user2 is in a group called "SecondGroup")
I want to make "user1" my approver in the workflow.
After the approval step, I want to create an SCTASK and assign it to Group "SecondGroup" and also specifically to "user2".
What's the best way to do this in my workflow?
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2020 01:53 PM
use below for dynamic
answer = [];
answer.push(current.variables.hrbp.toString());
For task
Is your hrbp variables a reference field ? can you share screenshot?
aslo try
task.setDisplayValue('assignment_group', 'HRD Group');
task.assigned_to = current.variables.hrd.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2020 01:48 PM
Mike,
I think you're on the right track here.
Your script sucessfully assigned to the approval task to a specific person using their sys_id.
Now I want to dynamically assign this approval to the RITM variable: hrbp.
(This is the name of a person in a group used in the pulldown.)
The Task Scrip also succesfully assigned to the group group, but did not assign to any user.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2020 01:53 PM
use below for dynamic
answer = [];
answer.push(current.variables.hrbp.toString());
For task
Is your hrbp variables a reference field ? can you share screenshot?
aslo try
task.setDisplayValue('assignment_group', 'HRD Group');
task.assigned_to = current.variables.hrd.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2020 04:24 PM
That worked great!
Thanks so much for your help Mike.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2020 01:10 PM
I tried both of your scripts as well and neither worked for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2020 01:15 PM
Sanjiv,
I also tried these.
var grp = new GlideRecord('sys_user_group');
grp.addQuery('user',current.variables.hrd);
grp.query();
if (grp.next())
{
task.assignment_group = 'HRD Group';
}