How to Auto populate RITM assignment Group based on catalog task assignment group .

suresh40
Tera Contributor

Hi All,

My requirement is ,  Auto populate Ritm assignment Group based on catalog task assignment group. Please help me on this.

 

Thanks, 

Suresh

1 ACCEPTED SOLUTION

Shakeel Shaik
Giga Sage
Giga Sage

Hi Suresh,

 

 You want to populate same catalog task assignment group in RITM assignment Group??

if Yess, then 

Create BR

Script:

(function executeRule(current, previous /*null when async*/ ) {

    var ritm = new GlideRecord('sc_req_item');
    ritm.addQuery('sys_id', current.request_item);
    ritm.query();
    if (ritm.next()) {
        ritm.assignment_group = current.assignment_group; 
		ritm.update();
    }


})(current, previous);

 

 

If my response is helpful, then Please mark as Correct Answer/Helpful.

Please check and let us know.

Thanks 🙂

Shakeel Shaik.

Thanks,
Shakeel Shaik 🙂

View solution in original post

5 REPLIES 5

shivambitanwar
Tera Expert

Hi Suresh,

 

Do you have any workflow running on RITM? you can add script in create task activity to populate RITM assignment group.

 

current.assignment_group = task.assignment_group

 

if you have to do it for all the tasks in general, you should write a after BR running on insert and update  on sc_task table to sync the assignment group from task to ritm. in this case also think about if there are multiple tasks to a RITM then which task's assignment group should be populated.

 

Regards,
Shivambi

Hi Shivambi,

Can you please provide Business script for that.

Adrian Ubeda
Mega Sage
Mega Sage

Hi Suresh,

What about having more than a unique task under RITM? If you only have one task, you can achieve by this using flow/workflow or using a BR on after over sc_task table and your code should be somehting close to this:

var grRITM = new GlideRecord('sc_req_item');
grRITM.get(current.request_item);
if(grRITM.next()) {
    grRITM.setValue('assignment_group', current.assignment_group);
    grRITM.update();
}

If it was helpful, please give positive feedback.
Thanks,

If it was helpful, please give positive feedback! ✔
☆ Community Rising Star 22, 23 & 24 ☆

HI,

Its not working