- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 10:12 AM
Hi Team
Recently I got a one requirement that Incident should be auto closed immediately once it's created if a short description contains "xxxxxxxxxx" and watch list contains "xxxx email id" and assignment group is "xxxx".
In my instance , every day one incident is getting created and auto assigning to a group "xxxx", so "xxxx" group people requested us be auto close it immediately once it's created in ServiceNow as they don't that ticket any more.
Could you please suggest that how to auto close the incidents if the above conditions are met ?
Thanks in advance
Nagurbi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2024 11:55 PM
Hi @Nagurbee1
Probably, it's a flow then which is creating the incident on the reception of email. Search for flows with trigger type as email and check. Also, creating a before insert business rule on the incident table should do the trick as you are restricting the insert operation itself which is independent of the source.
For the issue with selecting a dynamic watch list recipient, can you please confirm if you have an account created for the DL in your instance. If not, then we need to script the condition to check Watch List users.
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2024 11:55 PM
Hi @Nagurbee1
Probably, it's a flow then which is creating the incident on the reception of email. Search for flows with trigger type as email and check. Also, creating a before insert business rule on the incident table should do the trick as you are restricting the insert operation itself which is independent of the source.
For the issue with selecting a dynamic watch list recipient, can you please confirm if you have an account created for the DL in your instance. If not, then we need to script the condition to check Watch List users.
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 03:55 AM
Hello Amit
I have created a before insert business rule and it worked.
Thank you so much for your help 🙂 and I am accepting your solution.
Thank you
Nagurbee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 09:52 PM
You can write Before Insert BR, Below is the code:
(function executeRule(current, previous /*null when async*/) {
if (current.short_description.includes("xxxxxxxxxx") &&
current.watch_list.toString().includes("xxxx email id") &&
current.assignment_group == "xxxx") {
current.state = 7; // Set state to "Closed"
current.close_code = "Auto-closed";
current.comments = "Incident auto-closed as per request.";
current.update();
}
})(current, previous);
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 09:56 PM
no code needed for this... @Amit Verma has recommended the right and lowcode approch
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....