How to populate assignment group on the Ritm form based on a reference variable?

Rini1
Tera Guru

Hi all,

So there is a field called area (u_area) on the location table. I have a variable (work_location_from) referencing location table on the catalog item. 

I am trying  to populate the assignment group on the Ritm form based on the location user selects on the form. And assignment group should the area of that specific location. Below is the runscript which Iam trying to execute but it doesnt work.

current.assignment_group = current.variables.work_location_from.u_area;
I also tried "current.variables.assignment_group = current.variables.work_location_from.u_area;"
Is it possible to push the area of the location into the assignment group on the ritm form?
 
Thanks
Rini
8 REPLIES 8

jcmings
Mega Sage

I would recommend trying to do this via Assignment Rules instead of script. You can configure a different assignment rule for each work location. This will be easier to maintain in the future, and won't require you to maintain a choice list. One alternative you could do is update the u_area field to a reference that points to group, and you can use a reference qualifier to limit the options (so that way you don't see every group, but only the relevant ones).

Thank you for the reply. Even we thought of creating assignment rules but in future it will need some maintenance. Say if we create any new location for some Area, it needs to be added under the rules. So we are looking for something with less maintenance. 

Hi @Rini1 

 

I agree @jcmings . An assignment rule would work well for this. As for maintenance, yes, that's manageable. The good part is that it's just a configuration, which can be done easily and won't impact anything else.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

If you really wanted, you could set up the assignment rule to point to the u_area field via script so that the only update necessary is to the u_area field... but this involves scripting, slightly increases the technical debt, and makes it a little bit harder for someone to follow your work. I'd probably stick with assignment rules; the maintenance is minimal in the grand scheme of things.