Setting assignment group of task within worklow

Dawid2
Giga Guru

Hello,

 

I'm facing quite unusual situation. I have Catalog Task activity on my workflow that states following in the script:

var siteValue = current.variables.site.toString();
var VMlocation = current.variables.vm.location.country.name.toString();

if (current.variables.region == 'apac' && siteValue == 'CN' || VMlocation == "China") {
    task.assignment_group.setDisplayValue("Group A");
} else {
	task.assignment_group.setDisplayValue("Group B");
}

What happens is that when me as an admin raise a request - assignment group setting works fine. However, when a generic 'end-user' places the request - assignment group shows empty. Does anyone know what could be a problem here?

3 REPLIES 3

Sumanth16
Kilo Patron

Hi @Dawid2 ,

 

Please pick the catalog task activity from the workflow activities as shown below:

 

 

Sumanth16_0-1710944465027.png

 

And in the fullfillment group you can mention your assignment group

 

Sumanth16_1-1710944464918.png

 

var gr = new GlideRecord("sc_task");
gr.addQuery("request_item", current.sys_id);
gr.query();
if (gr.next()) {
gr.assignment_group = "SYS_ID_OF_GROUP"; 
gr.update;
}

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

Thanks for this but this doesn't solve my problem, assignment group should be set dynamically.

Hi @Dawid2 ,

 

Please check one condition opened by user, check whether the user is admin or not in the script, then it may be works 

 

Thanks

Arun

 

Please mark helpful,If the solution is fine.