workflow runscript to approve automatic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2016 01:02 PM
HI,
Currently in our system when a change request is created they also need to submit it for approval(UI Action),this will generate approvals(through workflow) for each member of CAB team and one of the user from CAB team will review and approve their approval request and the next approvals will be generated to the CI owners.
what we want to modify is if someone from CAB team submit for approval workflow triggers and generate approvals for each member of CAB team and what we want here is the approval request of the person who submitted should be automatically Approve his approval request. i am guessing this could be either possible through runscript in workflow activity or a business rule. anyhelp will be greatly appreciated.
thanks,
sry
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2016 10:44 AM
What version of ServiceNow are you running?
Have you made any customizations to approvals?
Your first step would be to analyze the Business Rules on approval records.
If the cause is not obvious, try the field watcher on the State field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2018 06:31 AM
I have the same need. How can this be modified to be used as a Run Script instead of a BR? Here is my workflow; I don't want 'Role Owners' to have to Approve twice if they own more than one role:
Here is the script I am using in each of my 'Approver - User' actions:
var gr = new GlideRecord('u_database_roles');
gr.get(workflow.scratchpad.role_names[0]);
answer = [];
answer.push(gr.u_role_owner);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2018 06:00 PM
Hi Nicole - I ended up moving away from a business rule and added the following to my Workflow (at the service catalogue level)
The If statement occurs after the request is submitted for approval (requested) - it checks to see if the line manager is the same as the requestor
If yes then it sets the values on the ticket
It then marks the ticket as approved by the person submitting the request
Hope this helps
cheers