- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 06:10 AM
Hey guys,
I am working on a task in which when I select options from Slushbucket or list collector variable in SR and order it.
then as per selected options Approvals goes to different users??
while searching through the community I tried different Approval Scripts but didn't worked. Please help? ctomasi
I am creating workflow on sc_req_item
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 02:04 PM
In your user approval activity, check the advanced check box and put this script in there
answer=[];
var arr= current.variables.SR.getDisplayValue().split(',');
for(i=0; i<arr.length; i++){
if(arr[i].trim()=='A'){
answer.push(sys_id of user X);
continue;
}
if(arr[i].trim()=='B'){
answer.push(sys_id of user Y);
continue;
}
if(arr[i].trim()=='C'){
answer.push(sys_id of user z);
continue;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 01:15 PM
yes somewhat its hard code i want to know how it works ?? for X Y Z i can put sysid of the users. rest please tell??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 02:04 PM
In your user approval activity, check the advanced check box and put this script in there
answer=[];
var arr= current.variables.SR.getDisplayValue().split(',');
for(i=0; i<arr.length; i++){
if(arr[i].trim()=='A'){
answer.push(sys_id of user X);
continue;
}
if(arr[i].trim()=='B'){
answer.push(sys_id of user Y);
continue;
}
if(arr[i].trim()=='C'){
answer.push(sys_id of user z);
continue;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2016 11:47 PM