How to Skip Service Catalog Approval if Manager is opening a Request Item?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 05:35 AM
I am working to modify our existing on-boarding Catalog form. Here on our form we have field called "Manager (Employee's direct supervisor).
What I am looking for is when a manger himself is opening a request then it should skip the Service Catalog Approval process and create a task , Otherwise if request is opened by someone else it should trigger approval process to manager mentioned in "Manager " field. In order to achieve this i have tried below mention script but somehow it skipping the approval in both scenario, when raised by manager or by others.
answer = ifScript();
function ifScript() {
var manager = current.variables.nh_manager;
var openedBy = current.opened_by;
if (manager == openedBy) {
return 'yes';
} else{
return 'no';
}
}
On - Boarding form example
Variable name of Manager field
Can anyone help what I am missing to achieve the desired results. I am new to ServiceNow so my scripting not that advance.
Thanks & Regards,
Naresh
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 02:45 AM
Hi Prateek,
Thank you for helping me with this script. After using this script in both cases (request raised by Manager & Others) Catalog Item is triggering approval workflow but it does not show the approver name.
I think we have to see that user (sys_user) id mentioned in Manager field and opened_by should be same then only it will skip the manager approval.
In variable nh_manager I have selected type is reference which pulls users from sys_user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 06:45 AM
I dont see any approval record in your screenshot.
The stage you are point in the screenshot needs to be adjusted at the WF level.
Can you show how the workflow looks like?
Please mark my response as correct and helpful if it helped solved your question.
-Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 07:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2021 01:01 AM
Hi vinothkumar,
I also have same issue. I need to exclude BR for some catalog items. The scenario is, For approver "xyz" all approval request's for all catalog items should be auto approve except catalog item "abc". So I did'nt understand how to get catalog item name in when to run filter list of business rule.