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

SN_Learn
Kilo Patron
Kilo Patron

Hi @Vinya Jakkula ,

 

What will be the condition to check in order to assign different assignment group?

 

 

 

var assignmentGroup = '';

if(producer.variables.xyz == 'abc'){
assignmentGroup = '477a05d153013010b846ddeeff7b1225';
}
if(producers.variables.xyz == 'def'){
assignmentGroup = '0a52d3dcd7011200f2d224837e6103f2';
}

now, inside your loop for creating multiple records, assign this variable to the assignment_group field of the target table.

 

 

 

Mark this as Helpful / Accept the Solution if this helps

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Hi,

example I have a variable is there catering required? if it is yes. I need to assign the ticket to 2 groups.

Check the above provided code and update conditions accordingly.

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Community Alums
Not applicable

You can just create a flow that is triggered when the case is created by the record producer then have an action that creates the duplicate case record. Just drag and drop the data fields from the created case into the create record action with the exception of the assignment group. You could also go the record producer script route as previously suggested it's just a matter on how you want to maintain the solution.