- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2021 11:19 AM
I have a requirement to automatically assign tasks that are assigned to our Service Desk assignment group to the person that is assigned the the RITM.
Example:
John Smith is assigned to this RITM.
As tasks are created as the Flow progresses, they should all be assigned to John Smith if the tasks assignment group is Service Desk. In this example, John would be assigned to the top and bottom task and not the middle one.
I set up a BR to try to achieve this, but I can't get it working for some reason. This is what I've got so far:
Thanks for any help in advance!
Solved! Go to Solution.
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2021 05:33 PM
Ah. For that you'd just need another Business Rule on the sc_req_item table after Update with the Filter Conditions Assignment Group is Service Desk AND Assigned to changes. The script to find any tasks under this RITM, with the same assignment group, and not assigned to a user would look like this.
var tsk = new GlideRecord('sc_task');
tsk.addQuery('assignment_group', current.assignment_group);
tsk.addQuery('assigned_to', '');
tsk.addQuery('request_item', current.sys_id);
tsk.query();
while(tsk.next()){
tsk.assigned_to = current.assigned_to;
tsk.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2021 01:23 PM
First - Make the BR on the RITM table
Triggered on Assignment group = ServiceDesk
Assigned to is not empty
Assigned to Changes.
you can leave it Before.
Then in the advanced tab - glidequery the SCtask table - find the records that have
* Same Request Item sys id as the sys id of your RITM
* same Group as the group in your IT
* blank assigned to
while gr.next
gr.assigned to = current.assigned to
Voila
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2021 01:32 PM
Hi Dan,
Since you want to set the task Assigned to when the catalog tasks are created, your BR looks like it should work. Try changing it to before and only selecting Insert. I've had trouble dot-walking on the Actions tab, so if it still doesn't work clear that Set field values, and add the assignment to the script.
current.assigned_to = current.request_item.assigned_to;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2021 01:43 PM
Ahh my suggested psuedopath assumed that those tasks may have been all created and attached to the Parent RITM- before they determined which individual technician they wanted handling this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2021 03:14 PM
That could be the process/intention - it's always good to have multiple sets of eyes on an issue, to bring different perspectives, interpretations, and approaches.