How to create a problem automatically when an incident is registered with P1 priority?

prgupta
Kilo Contributor

Hi folks,

I have a requirement where i want to register a problem ticket automatically by the system when a P1 incident is created. How can i implement it?

Any suggestions would be greatly appreciated.

Thanks

PG

11 REPLIES 11

Tim Deniston
Mega Sage
Mega Sage

Create a new business rule on the Incident table. It would run in the context of After. The condition would be "Priority > Changes to > P1." Just use a GlideRecord to create the Problem and build a relationship between the new PRB and the INC.


Chuck Tomasi
Tera Patron

Hi Pradeep,



An INSERT business rule will work. Run it AFTER the incident is created.



Table: incident


Advanced: true


Insert: true


Update: true (if you want to capture those that change from P2-4 to P1)


When: After


conditions: current.priority.changesTo(1)


Script:


var prb = new GlideRecord('problem');


prb.newRecord();


prb.short_description = current.short_description;


// copy other fields here as needed


prb.insert()


Thanks a lot Chuck. It is quite helpful.


Sorry, I forgot to set up the relationship between the problem and incident (and a semicolon - and my standard disclaimer)



var prb = new GlideRecord('problem');


prb.newRecord();


prb.short_description = current.short_description;


// copy other fields here as needed


var pid = prb.insert();



current.problem = pid;


current.setWorkflow(false); // don't trigger business rules


current.update(); // NORMALLY BAD PRACTICE, but required here