Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Incident record producer map assignment group

AnthonyMull
Tera Contributor

Hi community

 

What is the best way to map incidents assignment groups from a record producer that will make sure all incidents have assignment groups

 

Thanks in advance

1 ACCEPTED SOLUTION

Huynh Loc
Mega Sage

Hi @AnthonyMull ,

Best practice is to set the Assignment Group directly in the Record Producer script using system properties.
This guarantees the assignment group is populated at creation time.

Assignment Rules can complement routing logic, but should not be relied on alone.

For full assurance, add a Before Insert Business Rule to catch any edge cases.

Set the Assignment Group directly in the Record Producer script:
Example: 
current.assignment_group = gs.getProperty('my.default.incident.assignment.group');

Use conditional logic in the Record Producer (when routing varies)

If your routing depends on user input (e.g. category, CI, region):

if (producer.category == 'hardware') {
current.assignment_group = 'HARDWARE_GROUP_SYS_ID';
} else {
current.assignment_group = 'SERVICE_DESK_GROUP_SYS_ID';

If this response was helpful, please consider marking it as Correct and Helpful. You may mark more than one reply as an accepted solution.

View solution in original post

4 REPLIES 4

Huynh Loc
Mega Sage

Hi @AnthonyMull ,

Best practice is to set the Assignment Group directly in the Record Producer script using system properties.
This guarantees the assignment group is populated at creation time.

Assignment Rules can complement routing logic, but should not be relied on alone.

For full assurance, add a Before Insert Business Rule to catch any edge cases.

Set the Assignment Group directly in the Record Producer script:
Example: 
current.assignment_group = gs.getProperty('my.default.incident.assignment.group');

Use conditional logic in the Record Producer (when routing varies)

If your routing depends on user input (e.g. category, CI, region):

if (producer.category == 'hardware') {
current.assignment_group = 'HARDWARE_GROUP_SYS_ID';
} else {
current.assignment_group = 'SERVICE_DESK_GROUP_SYS_ID';

If this response was helpful, please consider marking it as Correct and Helpful. You may mark more than one reply as an accepted solution.

Tanushree Maiti
Kilo Patron

Hi @AnthonyMull 

 

You can configure this in two ways using a producer script:

  1. Use a system property: Store the assignment group’s sys_id in a system property and reference it in your script. This approach is more flexible—if the business requests a group change in the future, you only need to update the system property without modifying the code.
  2. Set the sys_id directly: Assign the group’s sys_id directly in the script. This is simpler but less flexible, as any future change would require updating the code.

Example using a system property:

current.assignment_group = gs.getProperty("<system_property_name_containing_group_sys_id>");
 

Example using a direct sys_id:

 
current.assignment_group = "<group_sys_id>";
 
 
 
Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Ankur Bawiskar
Tera Patron

@AnthonyMull 

best way is to handle this within record producer script so that it becomes easier to debug going forward

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

pururavasin
Tera Contributor

Hello,

You can try setting the Assignment Group using "Data Lookup" definition.

Based upon category & subcategory,  you can populate the Assignment Group.