
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 10:41 AM
Hello all,
I am building out our Change Management piece of ServiceNow and one of the requirements was to skip the "Scheduled" phase and go straight into Implement after approval. If I change the workflow to set the state to implement instead of Scheduled it just doesn't do it and in fact it will freeze up the whole process because it's expecting to first goto Scheduled before it proceeds. We are OOB for the most part, any idea how I can accomplish this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 11:40 AM
Change request flows are now built on a set of script includes. The script includes come in pairs; one includes "SNC" in the name and is read-only. The other has the same name, but without "SNC" and is available for you to customize. That is the best-practice method for customizing change management for instances running the Change Management - State Model plugin.
Take a look at the script include "ChangeRequestStateModel_normal" to see the structure of the state models used by the Change Management application to control state flow. There are also script includes for Standard and Emergency changes.
You can see that there is a property in the script include for each state value. This property is an object with several of its own properties. The one you need for your question is the "next_state" array. Find the "authorize" property and change the next_state array from "scheduled" to "implement" in order to make that the next state. You will also want to update the workflow activity that sets the state to Scheduled and make it Implement (looks like you already did that).
However, I would caution that this will also populate the actual start date on the change request immediately after approval. You need to be sure this is what you want to do.
Hope that helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 01:42 PM
You also need to add an "implement" property in place of "scheduled," like so:
authorize: {
//nextState: [ "scheduled" ],
nextState: [ "implement" ],
draft: {
moving: function() {
return this.toDraft_moving();
},
canMove: function() {
return this.toDraft_canMove();
}
},
/*scheduled: {
moving: function() {
return this.toScheduled_moving();
},
canMove: function() {
return this.toScheduled_canMove();
}
},*/
implement: {
moving: function() {
return this.toImplement_moving();
},
canMove: function() {
return this.toImplement_canMove();
}
},
canceled: {
moving: function() {
return this.toCanceled_moving();
},
canMove: function() {
return this.toCanceled_canMove();
}
}
},

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 01:53 PM
I did but just to be sure I copied yours exactly and what happens now is it will not progress past Authorize...it's like somewhere else in the platform it knows it should be Scheduled and I stopped it from doing that so now instead of going to Implement it is just going to forever stay on authorize despite having approved it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 02:02 PM
I just tested in a developer instance and this works. The only gotcha is that the "Implement" UI action is visible in the Authorize state.
gs.hasRole('itil') && new ChangeRequestStateHandler(current).isNext("implement")
It turns out, if you leave the nextState array empty, the system will still move the states correctly and will not show the UI action. It will still go to the Implement state correctly (and still set the actual start) as long as you also make sure that you update the normal change workflow activity that sets the state to Scheduled and change it to Implement.
That workflow update is important.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 02:10 PM
Great Ill give it a go and see what happens, will let you know tomorrow but here on the East coast it's time to go home!
Thanks for the great explanation!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 02:11 PM
Sounds good, can't wait to hear how you get along.