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

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;
}

 

I am dancing in my seat over here!  I had tried to accomplish this before using a script in the workflow, but I was referencing the wrong table.  But it worked beautifully.  Since the initial task would usually kick off before the RITM was assigned, I added a wait for condition (assigned to is not empty) in the workflow so that the tasks would inherit the assigned to value.  Rock on, Josh.  I really appreciate it.