How to assign assignment group as per location

RunaliP
Tera Contributor

I am working on catlog item, my requirement is when line manager approve a request then it should be assign to that particular team as per the location.

 

In UI there is location field if requestor will select any location .

so according to that location it should be assign to that particular location team.

 

For this i have to create workflow. I m trying it with Run script 

please provide solution on it. 

 

Thank You

5 REPLIES 5

Runjay Patel
Giga Sage

Hi @RunaliP ,

 

If you have created location field on group table then use below script.

var groupSysId='';
var loc = current.variables.current_location; // Assuming "current_location" is the variable name
var gr = new GlideRecord('sys_group'); // Replace with your table name
gr.addQuery('location', loc; // Assuming location is field name in group table
gr.query();

if (gr.next()) {
    groupSysId = gr.sys_id;
}

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

Here in this Video, I have covered the Custom Application Pattern Troubleshooting and configuration Thank you for visiting my channel. Here, I'll share various technical knowledge. Feel free to reach out to me directly for any Service Now-related queries. Your support encourages me to consistently