Auto-approve request when the User itself is the approver of the request in Service catalog.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2018 11:10 AM
Hi All,
If the line manager raise the request of behalf of his reportee and for the same request ,the line manager is the Approver also.
In this case Request should get Auto approved.How to achive this ? Please support.
Ex.
User A raise the request,the request will go to his manager[User M] for approval .It is fine.
Now when User M raise request on behalf of User A,then the request should get auto approved.as User M is the Approver.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2018 11:27 AM
Hello Navneet,
You can add an "If activity" before the Approval activity, In the If activity you can confirm that If user is approver itself then output should leave the approval activity and If not then output should go to approval activity.
If you can send screenshot of your workflow and details of the approval activity and then I can write script for IF activity for you.
Thanks
Ziaur Rahman

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2018 11:29 AM
You can use the if and setValue activity to check if requested_by is a manager of requested_for then you can use the setValue activity to set the status to approved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2018 11:37 AM
May be you can try with below script in if activity, if result is yes then set to Set Value activity else send to Approval Activity.
answer = ifScript();
function ifScript() {
var gr = new GlideRecord('sys_user');
gr.get(current.request.requested_for);
if(gr.manager == current.opened_by)
return 'yes';
return 'no';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2018 11:48 AM