Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

create problem automatically from incident if priority is p1

ARNAB3
Giga Expert

Hi ,

I have  to achieve a requirement if  an incident is p1 then one problem ticket  will be created  automatically and linked to the incident.

Thanks ,

Arnab

5 REPLIES 5

Andrew Barnes -
ServiceNow Employee
ServiceNow Employee

Greetings Amab,

 You can solve this with a Flow, Workflow, or Business rule - conditioned on priority changes to 1, and problem field is empty. I myself would use a flow in flow designer. Trigger on Incident with those conditions, and a create problem action, and then update record (incident) action to set the problem field from the prior action.

-Andrew Barnes
Join me at Developer Blog

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Arnab,

have a before insert business rule on incident with condition as priority is p1

have below script in the business rule

var gr = new GlideRecord('problem');
gr.initialize();

// map whatever fields you want here from incident to problem

gr.description = current.description;
var sys_id = gr.insert();

current.problem_id = sys_id;

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Elijah Aromola
Mega Sage

Are there more details to this requirement? From my experience there are plenty of cases where a P1 isn't a problem. You can do a before business rule that runs on incident for this: 

 

Condition:find_real_file.png

Script: find_real_file.png

Pratima Kalamka
Kilo Sage

Hello @ARNAB3 ,

use after insert update business rule

condition:priority is p1

script:

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

           // Add your code here
 var shortdescription= current.short_description;
     var assignmentgroup=current.assignment_group;
     var st=current.state;

var gr=new GlideRecord('problem');
 gr.initaialize();
 gr.short_description=shortdescription;
 gr.state=st;
 gr.assignment_group=assignmentgroup;
 gr.insert();
 gr.addInfoMessage(gr.number + 'from create problem');
})(current, previous);
 
 
If my answer is helpful please mark it as helpful or correct!!
 
Pratima.k