- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 11:34 PM
I have a requirement Change should not be canceled after implement state. I do not want to touch OOB state flow
i have written BR - Before Insert and Update
Condition - State changes to canceled
But this is by passing my BR After giving cancelled reason and going to cancel state
@itil @sndev @Change @Chaitanya5
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 11:37 PM
it's better to handle it via state flow for the change type, please discuss this with your customer
in your business rule you should add this condition
State Changes From Implement AND State Changes to Cancel
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
current.setAbortAction(true);
gs.addErrorMessage('cannot cancel change from implement state');
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 11:43 PM - edited 04-07-2025 11:47 PM
Hello @VijayKummamuru ,
Are you using Change Models? If you do you can disable the Implement to Cancelled transition as shown below:
In the Change Model record open the "Implement" state:
And then remove the "Implement to Cancel" transition:
If you are not using Change Models you need to adjust your Business Rule: remove the advanced script and set the filter and actions as shown below:
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 01:33 AM
Hello @VijayKummamuru
You have given wrong condition. it should have been "previous.state == 'implement' //backend name" - because the previous state was impleent and current state is canceled.
I hope you got the error here. But I would say this script is not required.
Just add below in the "When to run and in "Actions" Abort it"
I hope this answers your issue also, and proposes a better way as well 🙂
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 11:37 PM
it's better to handle it via state flow for the change type, please discuss this with your customer
in your business rule you should add this condition
State Changes From Implement AND State Changes to Cancel
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
current.setAbortAction(true);
gs.addErrorMessage('cannot cancel change from implement state');
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 11:43 PM - edited 04-07-2025 11:47 PM
Hello @VijayKummamuru ,
Are you using Change Models? If you do you can disable the Implement to Cancelled transition as shown below:
In the Change Model record open the "Implement" state:
And then remove the "Implement to Cancel" transition:
If you are not using Change Models you need to adjust your Business Rule: remove the advanced script and set the filter and actions as shown below:
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 12:36 AM
Greetings!!
There are two things to consider:
-
First, you can keep the 'Cancel UI Action' for the admin change. That should be easy to do.
-
Second, there are a few scenarios you need to consider. These are examples based on my experience as a Change Manager:
-
Let's say a change just started, and within the next 5 minutes, an MI has been raised on the same CI, and the MIM states that the change will not move forward. In this case, what would the change state be?
-
Sometimes, due to complications, we need to cancel the change even if the implementation has started.
-
Also, if the change moves to the 'Implement ' state and it's dependent on a vendor, but the vendor doesn't reach the site or hasn't logged in, what would the change state be?
-
So, it's better to keep the 'Cancel Change' option but limit it to the Change Manager or System Admin only.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 01:33 AM
Hello @VijayKummamuru
You have given wrong condition. it should have been "previous.state == 'implement' //backend name" - because the previous state was impleent and current state is canceled.
I hope you got the error here. But I would say this script is not required.
Just add below in the "When to run and in "Actions" Abort it"
I hope this answers your issue also, and proposes a better way as well 🙂
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY