Script for RITM Assignment Rule

steveturley
Tera Guru

Hi, I'm trying to develop a script that will assign the RITM based upon the Requested For users location.

 

I've tried two scripts below based upon other community posts. Could anyone advise what's incorrect? I'm not even sure if my syntax is correct

 

steveturley_0-1672834849045.png

 

or

 

steveturley_1-1672834911555.png

 

Thanks!

 

 

 

6 REPLIES 6

SteveTurley,

You only need one rule per assignment group.

For just one Assignment Rule you could add a sys_user_group reference field to the location table...add the assignment group to the location record then you can lookup the group through the user's location.

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Mmm I see, well yes, in this case it would one item per scenario. But how about this:

  • Create a Decision Table in Decision Builder for your different scenarios, where the input is a Reference to the Location table
    LaszloBalla_0-1672850901738.png
  • Add this as condition
    LaszloBalla_1-1672850997354.png

     

  • Create a Result column that will be a Reference to the Group table
    LaszloBalla_2-1672851080796.png
  • So you will have a row each scenario like this
    LaszloBalla_3-1672851192105.png
  • Save your decision table, then open Flow Designer and create a new Flow, with Service Catalog Trigger

  • In Flow Logic, select 'Make a decision' and choose your decision table. It will then ask for the input you defined there (Location), so map the requested for user's location to that field
    LaszloBalla_4-1672851451721.png
  • You will now see a branch for each row in your decision table, but don't worry about those. Continue your flow in the main path, and add an 'Update Record' action, map the Requested Item to it from the trigger, choose the Assignment Group field, and map the 'Result Record' of the 'Make a decision' step as the value (remember, this is is a Group reference as the result column in your decision table).
  • Save and Activate the Flow (or maybe test first), and remember to deactivate any conflicting Assignment rules.
  • Since the Flow has a Service Catalog trigger, you will have to map it the Catalog Items and/or Record producers of your choice. If they already have flows mapped that do other stuff, then you can crate all of the above in a Subflow instead of a Flow, and create an Input for the Subflow which will be "Reference.Requested Item"

This way, you will only need t maintain your decision table in the future.