If there is a way to modify the workflow wherein if the user is brazil then the request assign BAG

Srinivasu2
Tera Contributor

Hi Community,

 

If there is a way to modify the Existing workflow wherein if the user is Brazil then the request should land to Brazil Assignment group

 

Srinivasu2_1-1696233315553.png

 

 

Please check this above screenshot and advise how can we modify the above workflow?

 

Regards,

Srinivasu

 

8 REPLIES 8

Srinivasu2
Tera Contributor

Hi Community,

 

Please find the attached screenshot for your better visibility

Vishal Birajdar
Giga Sage

Hi @Srinivasu2 

 

What is your need ...??

Is it checkout by someone else & you are not able to  modify it ...?

or do you want to know how to set assignment group depending upon location ?

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Hi @Vishal Birajdar,

 

Srinivasu2_0-1696236390245.png

 

I will tell somebody to publish this workflow, than i can edit this in dev instance, that's Ok

 

But Client ask us to modify this workflow if Brazil user submit this catalogue item, request should be auto assigned to Brazil assignment group,  if other users submit this catalogue item workflow will continue  with other activities

 

Regards,

Srinivasu 

Hi @Srinivasu2 

 

Assuming you are talking about assignment group on sc_task to be updated.

 

You can write script in catalog task activity 

 

// Set values for the task in this script.  Use the variable 'task' when setting additional values.
// Note: This script is run after the task values are set using the Fields, Template or Values you have specified.
//
// For example:
//     task.short_description = current.short_description;

/*1.Get the requested for*/
var reqFor  = current.requested_for;

/*2.glide record on sys_user table*/
var country;
var grUser = new GlideRecord("sys_user");
grUser.addQuery("sys_id", reqFor);
grUser.query();
if (grUser.next()) {
	
	country = grUser.location.country;
   
}

if(country == '<country_name here brazil>'){
	task.assignment_group = <sys_id of brazil group>;   //use system property to store sys_id. not to hardcode
} else {
	task.assignment_group = <sys_id of another group>; 
}

 

VishalBirajdar_0-1696238015218.png

 

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates