Automatically Close All Incidents When a User Becomes Inactive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi everyone,
I have a requirement in ServiceNow.
Requirement:
When a user is marked as inactive (Active = false) in the User (sys_user) table, all incidents created by that user should automatically be moved to the Closed state.
Example:
Suppose a user has created 5 incidents. When an administrator deactivates that user, all 5 incidents created by that user should automatically be closed.
I have the following questions:
1. Which type of Business Rule should I use for this requirement?
2. Should I create the Business Rule on the User (sys_user) table or the Incident (incident) table?
3. How can I retrieve all incidents created by that user and update their state to Closed?
4. What is the recommended approach to implement this requirement?
I would appreciate any suggestions or guidance.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @yashhaval45 ,
I hope you are okay with closing rather resolving.
There are a couple of ways to do this. This approach is transactional (not scheduled) and requires no scripting:
-
Create a Flow Designer flow on the User table.
-
Set the trigger conditions: Active changes, AND Active changes to false.
-
Add a Look Up Records action on the Incident table where the Caller is the user and Active is true (Note: this will also include resolved incidents).
-
Add a For Each logic block for the looked up records. Update the incident State to Closed, making sure to also populate the mandatory fields or work notes
-
End the flow.
Example:
Hope helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @yashhaval45 ,
If this response helped, please close the loop by accepting the solution or ask a follow-up question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Closing an Incident usually isn't just a matter of setting state.
Your Incident configuration may have mandatory closure fields such as:
- Close code
- Close notes
- Resolution information
Thank you,