Incident state is set to active from closed by system after few days of incident closure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2023 01:18 AM
can anyone let me know why this happend
Incident state is set to active from closed by system after few days of incident closure for two of the incidents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2023 02:00 AM
Hello @sushmachava
there is an auto-closure script which does this
business rule: incident autoclose
search in schedule job name as: Autoclose Incidents
the 5 days or 7 days is a property configured 'glide.ui.autoclose.time'
It is occuring due to schedule job and BR auto close.
Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2023 02:25 AM
Hi,
i am aware of this functionality, after incident got closeed it was again moved from closed to active by system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2023 03:56 AM
HI @sushmachava ,
I trust you are doing great.
Analyze Incident State Change:
- Review the incident records that experienced the state change to identify any common patterns or triggers causing the issue.
Implement Incident State Validation:
- Develop a Business Rule that runs when an incident is closed to validate the state change.
- Ensure the rule checks for any factors that may trigger a reactivation of the incident.
Create a Scheduled Job:
- Set up a Scheduled Job that periodically checks closed incidents for any anomalies and reverts the state if required.
Log and Notify:
- Implement logging mechanisms to keep track of any state changes and the reason for reactivations.
- Notify the relevant stakeholders (e.g., IT team, incident owners) whenever a state change occurs.
Scheduled job script
(function run() {
var gr = new GlideRecord('incident');
gr.addQuery('state', 7); // 7 represents "closed" state
gr.addQuery('closed_at', '<', gs.daysAgo(3)); // Adjust the number of days as needed
gr.query();
while (gr.next()) {
// Add your validation criteria here
// For example:
// if (gr.assigned_to == '') {
// gr.state = 6; // Set the state back to "closed"
// gs.log("Incident state reverted to closed due to missing assignment. Incident Number: " + gr.number);
// gr.update();
// }
}
})();
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2023 10:44 AM
Hi @sushmachava
Check is any schedule job is running.
Any flow / workflow attached.
Any inbound action?
Please mark this response as correct or helpful or the solution accepted if it assisted you with your question.
Regards
Atul G.
Learn N Grow With Atul G
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]
****************************************************************************************************************