Change Workflow - Adding Condition to Approval - User
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2013 09:27 AM
I was looking at the article from "http://wiki.servicenow.com/index.php?title=Custom_Transitions_for_the_Approval_-_User_Activity" because I wanted a third condition called More Information Required on the Approval - User object in my workflow. I've added the condition and performed all the steps in the Wiki article.
What I want is for the State under the Approvers tab on the Change to change FROM Requested TO Information Required which I've added AND to progress the workflow as shown in the screenshots. Unfortunately, I am getting the two scenarios below.
When the script below is added to Approval - User, the State remains Requested and the workflow progresses as needed...called Script 1 in the screenshots. Only issue here is that I want the state to change as mentioned above.
if(approvalIDs && approvalIDs['more']) {
answer = 'more';
} else if (counts.approved > 0) {
answer = 'approved';
} else if (counts.rejected >0) {
answer = 'rejected';
}
When the script below is added in place of Script 1 above, the State change, but I get an error in the workflow.... called Script 2 in the screenshots
if (counts.approved > 0) { answer = 'approved'; }
else (counts.rejected> 0) { answer = 'rejected'; }
else { answer = 'more'; }
I've added some screenshots to help show what I am talking about. In short, I am trying to have an option in the workflow to ask the submitter for more information rather than approving/rejecting the Change Request. I am new and finding this difficult to do, but will appreciate any help!
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2016 05:58 AM
Glad to help Suhas. Feel free to ask any more questions as needed. Sharing is caring.