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-06-2016 02:58 PM
Thanks for the response Shane. I know it's been a while since you've implemented this solution Final question - where exactly are you creating a new state on Change Request table called 'More information' as the notification you have is on that table and it will only be fired if the change request reaches that state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2016 06:16 AM
Suhas,
I wish that I would have created a design document back then as I do on today's designs! Honestly, this design has been used very few times and probably wasn't worth the work it involved to complete. The "Information Required" state is a choice list on the "State" field. I've included a small screenshot for you.
I'm sure you know this, but it is very important to mention. As with all new choices that you add when related to the root Task table as change_request is, make sure that the new state's value doesn't conflict with any other value [use a numerical value that's not used on any other choice]. Such as, Closed and Closed Complete can both have the same value, but Open and Closed should have different values because they don't perform the same action. This article can help if you have questions.
Shane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2016 08:07 PM
Thanks Shane.
Reason for asking you was I couldn't see this state being created on 'change_request' table in your steps and also how the change_request state gets changed to 'Information Required' when the approval record gets changed to 'More Information Required'?
Am I missing something here mate ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2016 09:12 AM
Suhas,
I tested changing an approval to More Information Required in our TEST instance. The approval changed and an email was sent, but the Change Request's State did not change. So, I guess my information was wrong about the Change Request state though there was a state created. That's very possible why I didn't include it in my steps above!
Shane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2016 04:12 PM
Thanks a lot mate. Got a fair bit of idea now, will tweak it based on my requirement.
Cheers!