Copy the Description, Short Description of existing incident record onto the existing problem record

Deepak Shaerma
Kilo Sage
  1. Copy the Description, Short Description of existing incident record onto the existing problem records' description and short description.

8 REPLIES 8

thank you gunjan, its working

Please mark it as correct and close the thread.


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

Saurabh Gupta
Kilo Patron
Kilo Patron

Write an onAfter BR on incident table with condition problem is changes and problem is not empty.
copy short desc and des of incident on problem.



Thanks and Regards,

Saurabh Gupta

Aman Kumar S
Kilo Patron

Hi @Deepak Shaerma 

I believe you must be talking about the UI action that is used to create Problem from the incident form.

We already have a property which takes care of this.

Refer to the screenshot:

Capture87.PNG

 

 

 

 

 

 

 

 

 

 

 

When it comes to existing ones, you can place this script in fix script or scheduled job.

var incGR = new GlideRecord("incident");
incGR.addEncodedQuery("problem_idISNOTEMPTY");
incGR.query();
while (incGR.next()) {
    var probGR = new GlideRecord("problem");
    if(probGR.get(incGR.getValue("problem_id")){
    		grProb.setValue("description", incGR.getValue("description"));
		grProb.setValue("short_description", incGR.getValue("short_description"));
		grProb.update();
    }
}

 

Best Regards
Aman Kumar