- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 06:30 PM
Hello Everyone,
I have one requirement .In incident form having the two files are you able to close the Duplicate Incident?(it's a check box and true/ false type) and Duplicate incident is List type. if i select the multiple incidents in Duplicate incident table after update the main incident form after then selected incidents should all go to close state irrespective state and SLA state of selected incidents in Duplicate incident List type fields.please provide solution this one.
Regards,
Manohararuna
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 06:53 PM
Hi @Manohararuna ,
create an after update BR
add a filter condition Duplicate Changes and Are you reporting duplicate incident? IS true
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var incGr = new GlideRecord('incident');
incGr.addEncodedQuery('sys_idIN' + current.getValue('u_duplicate_incident'));
//replace u_duplicate_incident with Duplicate incident backend name if it's different
incGr.query();
while (incGr.next()) {
incGr.setValue('state', 7);
incGr.setValue('close_code', 'Duplicate'); //replace with your a choice of close code
incGr.setValue('close_notes', 'Duplicate of ' + current.getValue('number'));
//add additional fields if required
incGr.update();
}
})(current, previous);
you might have to update the line number 5 and 10 with proper backed names (u_duplicate_incident and Duplicate(choice value)) if those are different in your system
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 06:53 PM
Hi @Manohararuna ,
create an after update BR
add a filter condition Duplicate Changes and Are you reporting duplicate incident? IS true
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var incGr = new GlideRecord('incident');
incGr.addEncodedQuery('sys_idIN' + current.getValue('u_duplicate_incident'));
//replace u_duplicate_incident with Duplicate incident backend name if it's different
incGr.query();
while (incGr.next()) {
incGr.setValue('state', 7);
incGr.setValue('close_code', 'Duplicate'); //replace with your a choice of close code
incGr.setValue('close_notes', 'Duplicate of ' + current.getValue('number'));
//add additional fields if required
incGr.update();
}
})(current, previous);
you might have to update the line number 5 and 10 with proper backed names (u_duplicate_incident and Duplicate(choice value)) if those are different in your system
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 10:30 PM
Hello Chaitanya,
as per your solution, we are able to close the only one Duplicate incident at a time.
Thanks,
Manohararuna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 10:40 PM
it should work
Please share the screenshots of the BR
I want to see when to run and the script
you can also go with Flow Designer
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 10:58 PM
Hello Chaitanya,
Thanks you so much for your solution.
Regards,
Manohararuna