able to close multiple incident in Main incident

Manohararuna
Tera Contributor

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

Manohararuna_0-1752715769663.png

 

1 ACCEPTED SOLUTION

Chaitanya ILCR
Kilo Patron

Hi @Manohararuna ,

create an after update BR

add a filter condition Duplicate Changes and Are you reporting duplicate incident? IS true

 

ChaitanyaILCR_0-1752716905309.png

ChaitanyaILCR_2-1752717108399.png

 

(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

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@Manohararuna 

you can use flow designer for this with no-code

what did you start with and where are you stuck?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hello Ankur,

 

     is it possible through the Business rule. if not please send me the flow designed solution , otherwise send me the business rule 

 

Thanks,

Manohararuna

@Manohararuna 

Your requirement can be easily done with flow designer with low-code, no-code approach.

What did you start with and where are you stuck?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader