- 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 03:27 PM
Awesome! That worked for new tasks. Is there a way to assign already created tasks that are unassigned to the assigned to RITM analyst? The way we currently work tickets, some of the RITMs are being grabbed at their fulfill task and some have just started and are waiting approval.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2021 04:12 PM
If you're talking about a one-time assignment since these tasks were created before the business rule was created, you can run a fix script. The script to update ALL tasks assigned to the Service Desk, that have a blank assigned to, that are associated with ALL RITMs that are assigned to the Service Desk, and have an assigned to, would look like this. You can limit this to certain Catalog Item(s) if that's what you're looking for.
var sd = '12321434141jjk1323';//replace with sys_id of Service Desk group
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('assignment_group', sd);
ritm.addQuery('assigned_to', '!=', '');
ritm.query();
while(ritm.next()){
var tsk = new GlideRecord('sc_task');
tsk.addQuery('assignment_group', sd);
tsk.addQuery('assigned_to', '');
tsk.addQuery('request_item', ritm.sys_id);
tsk.query();
while(tsk.next()){
tsk.assigned_to = ritm.assigned_to;
tsk.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2021 04:28 PM
Sorry, no. Right now, a ticket can come in with a task generated on it for SD to fulfill the request. We have been running into issues where an analyst will assign the RITM to themselves, do some work on the ticket (usually requesting more info), then forget to assign the task to themselves while waiting for a response from the end user. This is causing our SLA response times on SCTASKs to be much higher and usually breach when we are already working on the ticket. Ideally, we would want the task that is already generated to assign itself to that analyst when they assigned the RITM to themselves to stop the SCTASK SLA response timer.
- 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
‎04-01-2021 09:44 AM
That did it! Thanks so much! Thought I was gonna have to back log this one.