How to set the assignment group in request form as per the task's assignment group.

shrinivasprasad
Tera Expert

Hi All,

I want to set the assignment group in request form as per the task's assignment group which is generated within it.

find_real_file.png

kindly suggest on this.

in advance thanks.

Thanks,

Shrinivasprasad

1 ACCEPTED SOLUTION

Hi,

the above script should work; did you try adding logs and check

Can you share the script you are using in catalog task activity script section

var record = new GlideRecord('sc_request');
record.addQuery('sys_id', current.request);
record.query();
if(record.next()){

gs.info('Inside Record');

 record.assignment_group = task.assignment_group;
 record.update();
}

Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

21 REPLIES 21

Brad Bowman
Kilo Patron
Kilo Patron

In the workflow on the catalog task activity, you can add an advanced script like this

var req = new GlideRecord('sc_request');
req.addQuery('sys_id', current.request);
req.query();
if(req.next()){
req.assignment_group = task.assignment_group;
req.update();
}

Brad Bowman
Kilo Patron
Kilo Patron

There have only been 2 so far - we need a couple of more people to post the same correct answer after the first one (mine), just to re-enforce it I guess.  Or submit a wrong answer, then you can edit it later to change it to the right one. 

Kalyani35
Tera Guru

Hi Srini,

Is this requirement is specific to a catalog item? 

You can write an after update Business rule on Task table and by hitting a Glide record on the Request table you can update the Assignement group.

But,it really depends on the catalog task you want to perform this update for. As a part of your process there might be multiple catalog tasks? Can you please elaborate your requirement more so that I can help further

Thanks!

Hi Kalyani,

yes, this requirement is specific to a catalog item.

when we raise the request the assignment group is displaying in the tasks form, there are two tasks that will generate within the RITM, I want to set the assignment group of the first task to REQ form.

 

Thanks in advance.

Thanks,

Shrinivasprasad  

 

Hi,

Did you check the script mentioned previously.

posting it again

var record = new GlideRecord('sc_request');
record.addQuery('sys_id', current.request);
record.query();
if(record.next()){
 record.assignment_group = task.assignment_group;
 record.update();
}

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader