How to update assignment group in workflow task

Yaalini Sakthiv
Giga Contributor

Hi,

I have a requirement where I'm stuck with the workflow.I have a variable called 'offering' which a reference field of 'service_offering' table.Now I want to update the assignment group in sc_task form.The group I need to update is from the offering reference field where we have a field called L3 support group in service offering table if L3 support group is not empty it should update that in the task assignment group else it should update a field called L2 support group in service offering table.So this is the case. As the offering field is reference I'm not sure how to get the fields of that reference field through workflow catalog task.

Can someone help me with this!!

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi,

Try this script in advanced option - make sure to update with your fields/variables name.

var record = new GlideRecord("service_offering");
record.addQuery("sys_id", current.variables.offering);
record.query();

if(record.next()){
if(record.support_l3 != ""){
task.assignment_group =  record.support_L3;
} 

if(record.support_l3 == "" && record.support_l2 != ""){
task.assignment_group =  record.support_L2;
}

}

 

Thanks,

Sagar Pagar

The world works with ServiceNow

View solution in original post

3 REPLIES 3

Sagar Pagar
Tera Patron

Hi,

Try this script in advanced option - make sure to update with your fields/variables name.

var record = new GlideRecord("service_offering");
record.addQuery("sys_id", current.variables.offering);
record.query();

if(record.next()){
if(record.support_l3 != ""){
task.assignment_group =  record.support_L3;
} 

if(record.support_l3 == "" && record.support_l2 != ""){
task.assignment_group =  record.support_L2;
}

}

 

Thanks,

Sagar Pagar

The world works with ServiceNow

Hi,

Have you tried this? or where you stuck, let us know?

 

Thanks,

Sagar Pagar

The world works with ServiceNow

Hi,

Thank you for this. It worked perfectly