How to Auto Approve if the opened by is a member of a group?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 08:34 AM
I am looking for a way to auto approve a request if the opened by is a member of a group? Can someone help me how to code it!!!
Thanks.
pK
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 09:27 AM
Well, you can use a workflow.scratchpad. store the value true inside the loop and then call it within the condition of user approval..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 09:29 AM
Didnt get you...
Thanks,
pK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 09:35 AM
You have to use a if block, use the code :
var usr = new GlideRecord('sys_user_grmember');
usr.addQuery('user', current.opened_by);
usr.query();
if(usr.next()){
workflow.scratchpad.skip = 'true';
}
Then double click on the skipped path on the approval and in the condition write : workflow.scratchpad.skip == 'true';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 10:02 AM
No luck
Thanks,
pK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 11:25 AM
Please post some relevant scripts.. and place logs..