How to add child incidents in related incident tab in problem form

panchbhaic
Tera Contributor

We need to add all child incidents in related incident tab in problem form. When we create problem from Incident using UI action in the related incident tabs it shows only parent incident number, but it does not shows child incidents.

 

 

 

 

1 REPLY 1

Chaitanya ILCR
Kilo Patron

Hi @panchbhaic ,

create a BR 

on problem table 

ChaitanyaILCR_0-1753118326687.png

ChaitanyaILCR_2-1753118363860.png

put this in the condition

current.first_reported_by_task && current.first_reported_by_task.sys_class_name=='incident' 

 

script

(function executeRule(current, previous /*null when async*/) {

	var orginalTask = current.getValue('first_reported_by_task');
	var incGr = new GlideRecord('incident');
	incGr.addEncodedQuery('parent_incident='+orginalTask+'^ORparent='+orginalTask);
	incGr.query();
	while(incGr.next()){
		incGr.setValue('problem_id',current.getValue('sys_id'));
		incGr.update();
	}

})(current, previous);

 

or 

 

you can also use the flow designer 

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya