Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

multiple tickets in one record producer

Vinya Jakkula
Tera Contributor

Hi Team,

I have requirement like Iam creating hr case through record producer, but I need to create one more ticket with same values but different assignment group. Please suggest me.

6 REPLIES 6

James-B
Kilo Sage

You can also do something like this in your RP script:

 

 

// Create the additional record
var gr = new GlideRecord('incident'); // Example
gr.initialize();
gr.short_description = producer.short_description;
gr.description = producer.description;
gr.insert();

 

 

This may come with a minor issue in that it will only create the variable records for the initial record but this wont be a problem if you aren't using the variable editor formatter on your target record which I suspect you wont be. 

You could combine this with what SN_Learn said and do something like so:

 

current.assignment_group = "GroupSysID";

If(producer.catering_required == 'yes'){
   // Create the additional record
   var gr = new GlideRecord('incident'); // Example
   gr.initialize();
   gr.short_description = producer.short_description;
   gr.description = producer.description;
   gr.assignment_group = "GroupSysID2";
   gr.insert();
}