Whenever Priority 1 incident is open then Problem Ticket should be genetrated automatically. How can i achieve this through Business rule.?

Prabhat4
Tera Contributor

Hi guys,

I'm trying to create problem ticket through P1 INC generation. i want to achieve this by using business rule. Please advise how can i achieve this, response in beginning to end is much appreciated.

Thanks

Prabhat

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

Hi Prabhat,



as deepak.ingale has already suggested with after business rule that will work perfectly.


i am just adding few points here.


if you will create problem from incident then in problem form there is a related list "Incident" when ever some Problem get created from that incident will attached there.


so here you go try with script below. i tested and it's working perfectly.



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



// Add your code here


var CreateProb = new GlideRecord('problem');


CreateProb.short_description = current.short_description;


CreateProb.cmdb_ci = current.cmdb_ci;


CreateProb.impact = current.impact;


CreateProb.urgency = current.urgency;


CreateProb.priority = current.priority;


CreateProb.company = current.company;


var sysID = CreateProb.insert();


current.problem_id = sysID;


current.setWorkflow(false);


var mySysID = current.update();



gs.addInfoMessage("Problem " + CreateProb.number + " created");


})(current, previous);




I used condition in business rule "When to run" tab.



find_real_file.png



To show the message either you use "Action" tab or gs.addInformMessage() function in script. so i used both of them.



find_real_file.png



incidents.png



Final Result



incidents.png


Hope it will help you.


View solution in original post

8 REPLIES 8

Prabhat4
Tera Contributor

Thank you everyone for your quick support, all three answers are correct but harshvardhansingh answer is perfect. it captures all the required aspects.



Thanks deepak.ingale &   saisowmya


Gareth Davies
Tera Contributor

Can I suggest you DON'T do this? I'm in the process of having this ripped out and replaced by a data policy that makes the Problem field mandatory for P1 and P2 incidents then the state changes to Resolved. It accomplishes the same thing and offers the choice to either search for an existing problem or create a new one (Create Problem link does most of the work).

You still ensure that all P1 incidents are linked to a problem record, but you don't automatically create one that then needs binning because there's an existing one. If you've applied the Madrid problem state update you can make it as a duplicate, but it's still wasted effort compared to linking to the existing problem in the first place.

Hi can you please tell, how you are achieving this?

Thanks 

Gaurav

As a data policy on the incident table with these criteria...

When state is one of Resolved or Closed 

AND priority is one of 1 - Critical or 2 - High 

AND parent incident is empty

And an associated data rule to specify that when those criteria are met problem_id becomes mandatory.

 

find_real_file.png