- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2025 10:09 PM
Hi Team,
I am writing a business rule to prevent incidents from being closed unless at least one work note is added. Although I have implemented this, it is not very user-friendly, so I am looking for some refinement or alternative solutions.
In my current code, I display an error message: "You cannot mark the state as closed until you add at least one work note."
However, the code does not revert the state to its previous status, like "In progress." While it shows an "Invalid update" message, it does not clearly indicate that the incident has not been updated and remains in its previous state. How can I achieve this?
(attached is my BR code snip and Incident form Error snip)
Thank you.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 10:09 AM
HI @Shailja Dosar ,
You don't have to glide sys_journal table for this, you can have below logic
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(current.work_notes.getJournalEntry(1).length==0){ //check if atleast one work note is addded
gs.addErrorMessage("You cannot mark the state is closed until update atleast one worknotes!!!")
current.setAbortAction(true); //Abort the action
}
})(current, previous);
Business Rule :
Result:
Ignore messages in blue, state says closed but you need to reload the state value is not updated in the database!
If you really want to abort the state change, apply the same logic in the 'Close Incident' UI action so that it will check the work notes first before setting the state to closed and throw errors.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 10:09 AM
HI @Shailja Dosar ,
You don't have to glide sys_journal table for this, you can have below logic
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(current.work_notes.getJournalEntry(1).length==0){ //check if atleast one work note is addded
gs.addErrorMessage("You cannot mark the state is closed until update atleast one worknotes!!!")
current.setAbortAction(true); //Abort the action
}
})(current, previous);
Business Rule :
Result:
Ignore messages in blue, state says closed but you need to reload the state value is not updated in the database!
If you really want to abort the state change, apply the same logic in the 'Close Incident' UI action so that it will check the work notes first before setting the state to closed and throw errors.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2025 10:56 PM