We have a scenario where we wanted route the assignment groups based on Country, category and subca

ujjwal0306
Giga Expert

We have a scenario where we wanted route the assignment groups based on Country, category and subcategory on the incident table. For that we wanted to go with low code/no code approach. I have tried creating country field on the incident, and Sys_choice table. Defined the assignment look up rules as well. They are working fine when we configure the values individually. 

Eg 1:   Category ABC

Subcategory XYZ

Country - USA 

the assignment group is auto populated in the agent view (using the assignment look up rules)

 

But, the issue we are facing when we wanted to change the country field from reference to string, as we wanted to avoid category, subcategory duplicates repeating for every country. Instead we want to make them comma separated and so that we could avoid lot of duplicate values in the choice table.

 

Category - ABC 

Subcategory - XYZ

Country - India,USA,Greece etc.,

Assignment group: Service Desk Tier1

 

When on incident form when somebody selects Category = ABC, Subcategory = XYZ , and country = USA we are expecting Assignment group should be populated with Service Desk Tier1.

 

The assignment look up rules doesn't work when we make them the comma separated values. 

Can anyone suggest how this can be achieved? 

Thanks in advance!

1 ACCEPTED SOLUTION

Harish Bainsla
Kilo Patron
Kilo Patron

It seems like you're trying to route incidents to assignment groups based on multiple criteria, including category, subcategory, and country. While you initially had a working solution with separate fields for each criterion, you encountered issues when you tried to use a single string field for multiple countries. This is a common problem when designing systems for data like this. Here's a possible solution:

  1. Maintain Separate Fields for Category, Subcategory, and Country:

    Instead of combining all the countries into a single comma-separated string, maintain separate fields for Category, Subcategory, and Country. This approach ensures clarity and simplicity in your data model.

  2. Create a Custom Script or Business Rule:

    You can use a custom script or a business rule to perform the assignment based on the selected Category, Subcategory, and Country. In your case, you want to populate the Assignment Group based on these criteria.

  3. Update the Script/Rule:

    In your script or rule, you would need to:

    • Retrieve the values selected in the Category, Subcategory, and Country fields.
    • Use these values to look up the appropriate Assignment Group from a mapping table or configuration.

    For example, you could create a mapping table in ServiceNow where each row contains a unique combination of Category, Subcategory, and Country, along with the corresponding Assignment Group.

  4. Write a Script/Rule to Lookup Assignment Group:

    Your script or rule would perform a lookup operation in the mapping table to find the matching row based on the selected values. Once the matching row is found, it can extract the Assignment Group associated with it.

  5. Populate Assignment Group Field:

    Finally, your script or rule would populate the Assignment Group field on the incident with the determined Assignment Group value.

By following this approach, you can maintain the clarity and flexibility of separate fields for your incident attributes while still achieving the desired functionality of dynamically assigning the correct Assignment Group based on Category, Subcategory, and Country.

View solution in original post

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@ujjwal0306 Instead of making country a string field, you can choose to convert it into a List type field.

Screenshot 2023-09-02 at 11.25.29 AM.png

List stores a comma separated values of sys_ids and you can apply a contains string search on it.

 

Also, can you share the screenshot of the assignment rule, I will suggest changes according to the List field type for the same.

Harish Bainsla
Kilo Patron
Kilo Patron

It seems like you're trying to route incidents to assignment groups based on multiple criteria, including category, subcategory, and country. While you initially had a working solution with separate fields for each criterion, you encountered issues when you tried to use a single string field for multiple countries. This is a common problem when designing systems for data like this. Here's a possible solution:

  1. Maintain Separate Fields for Category, Subcategory, and Country:

    Instead of combining all the countries into a single comma-separated string, maintain separate fields for Category, Subcategory, and Country. This approach ensures clarity and simplicity in your data model.

  2. Create a Custom Script or Business Rule:

    You can use a custom script or a business rule to perform the assignment based on the selected Category, Subcategory, and Country. In your case, you want to populate the Assignment Group based on these criteria.

  3. Update the Script/Rule:

    In your script or rule, you would need to:

    • Retrieve the values selected in the Category, Subcategory, and Country fields.
    • Use these values to look up the appropriate Assignment Group from a mapping table or configuration.

    For example, you could create a mapping table in ServiceNow where each row contains a unique combination of Category, Subcategory, and Country, along with the corresponding Assignment Group.

  4. Write a Script/Rule to Lookup Assignment Group:

    Your script or rule would perform a lookup operation in the mapping table to find the matching row based on the selected values. Once the matching row is found, it can extract the Assignment Group associated with it.

  5. Populate Assignment Group Field:

    Finally, your script or rule would populate the Assignment Group field on the incident with the determined Assignment Group value.

By following this approach, you can maintain the clarity and flexibility of separate fields for your incident attributes while still achieving the desired functionality of dynamically assigning the correct Assignment Group based on Category, Subcategory, and Country.