- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 12:44 AM
Can anyone please suggest how to do below task:
When user set value of state field to resolved then do this: -
Check whether current incident has value in parent field
- If yes, then check whether state of parent incident is resolved / closed. (If yes then allow user to save the record)
- If above condition is false then display error message that "Parent ticket should be closed before closing child ticket"
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2023 05:37 AM
did my respone resolve your issue?? if so,
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
08-17-2023 02:09 AM
Hi @Pawan Kumar Rai ,
You can create a Business Rule with condition : State Changes to Resolved
In the advanced tab you can add a script like this:
When an incident is resolved there is another business rules that runs OOTB : "Caller Close"
So I commented the lines 9 and 10 in this business rule and added the 'Incident {0} has been resolved' message in my business rule, so that you don't get duplicated Messages in your form.
Let me know in case I didn't get you requirement correctly and if this was helpful please mark my answer as correct 🙂
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 02:16 AM
Hi @Pawan Kumar Rai Write a before business rule on incident table with update operation and in the script condition please use the below code:
function executeRule(current, previous /*, g */) {
// Check if there is a parent incident
if (current.parent) {
var parentIncident = new GlideRecord('incident');
if (parentIncident.get(current.parent)) {
var parentState = parentIncident.getValue('state');
gs.info('Parent Incident (' + parentIncident.number + ') state: ' + parentState);
}
}
})(current, previous);
Thanks & Regards,
Eswar Chappa
Mark my answer correct and Helpful if this helps you 😀

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 02:36 AM
Hi @Pawan Kumar Rai ,
you don't have to write a single line of code , Condition builder are more powerful than we think , Use Business rule condition builder as below
1)when to run:
2)Action:
Output:
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
08-17-2023 07:09 AM
Not getting "Parent incident State" in filter option....What to do?.
Thanks for above solution.