Cascade RITM Assigned to to Catalog Task Assigned to

sarahyelton
Tera Expert

I would like to auto assign a catalog task to whoever the RITM is assigned to if the catalog task is assigned is assigned to a particular assignment group.  For example, Joe Smith who is in our Desktop Support group would be assigned the RITM for a new laptop.  I would want Joe Smith to be assigned the tasks if those tasks are assigned to the Desktop Support group.  I have a workflow running that creates the tasks and assigns it to the appropriate group.  I have tried a coupe different business rules (using examples I found in this forum) as well as using a script in the workflow.  Any suggestions?

1 ACCEPTED SOLUTION

Does this all occur in one workflow, or in across several workflows? I would suggest editing the workflow to set the "Assigned to" on the task to the "Assigned to" of the RITM. In the Catalog Task activity in your workflow, in the advanced section put

task.assigned_to = current.assigned_to;

That way when a task is created you have the "Assigned to" being set if there is one on the RITM, and then the business rule I provided would update the tasks later on if the "Assigned to" field gets populated/changed later on the RITM, the task's assigned to will also update. 

I would really recommend doing this in the workflow, in an effort to keep your Business Rules minimal and not have business rules reliant on Assignment Groups or Catalog Items, which could change down the line and be hard to keep track of. If you really need to do it outside of the workflow, then I would recommend creating a system property that houses the Sys Id of the Desktop Support group and use that in a condition. The reason you would use a system property is so you can use it across the platform, and if for whatever reason, the group changes, you just change that Sys ID in one place and it will change it for everything. This is a best practice, and one I highly recommend.

After you've got the System Property, create another before Business Rule on SC Task with "Insert" checked.

And in the advanced field paste this, and replace "SYSTEMPROPERTYNAME" with the system property name you've created. Maybe name it something like group.desktop.support.

var desktopSupport = gs.getProperty('SYSTEMPROPERTYNAME');

//Check to make sure the current assignment group is desktop support and matches the parent RITMs assignment group
if((current.assignment_group == desktopSupport) && (current.assignment_group == current.request_item.assignment_group)){
current.assigned_to = current.request_item.assigned_to;
}

 

View solution in original post

6 REPLIES 6

sachin_namjoshi
Kilo Patron
Kilo Patron

 

You can configure assignment rule on sc_task table to assign task to particular assignee.

 

find_real_file.png

 

Regards,

Sachin

Thank you, Sachin.  I am familiar with assignment rules, but I need the task to be assigned to whoever the RITM is assigned to.  This can vary day-to-day.  Any ideas?

Josh Virelli
Tera Guru

Hi Sarah,

Try adding this as a Business Rule rule that runs on Update when "Assigned To" "changes" in your condition builder, like so:

find_real_file.png

Click advanced and add this to the script field. Basically we will compare the assignment groups of the SC Tasks that have the current RITM as their parent. If they match, we'll update the Assigned To of the SC Tasks to the one that just changed on the RITM.

var sc = new GlideRecord('sc_task');
sc.addQuery('request_item', current.getUniqueValue());
sc.query();
while (sc.next()) {
    if (current.assignment_group == sc.assignment_group) {
        sc.assigned_to = current.assigned_to;
        sc.update();
    }
}

 

If that works, please mark my answer as Correct/Helpful! Otherwise happy to keep assisting you until we figure it out 🙂

-Josh

Hi Josh!

I got sidetracked on another project and now I'm back to this one.  This solution worked if the tasks had already been populated.  The workflows we use create tasks in sequence after completion of dependent tasks.  How can I leverage this to assign to our techs?  Also, I only want this to work if a task is assigned to the Desktop Support group via the workflow.  We have a couple other tasks that generate and are assigned to other work groups.

Thank you!  This is the farthest I've gotten on this!!

Sarah