Assign subsequent tasks to the same person who was assigned to the previous task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 09:33 AM
Hi All,
I hope you can help.
I have a request item that creates a task. It is mandatory that the task is assigned to a person before it is closed. I want any other tasks created on that RITM to have the same assignee as was on the closed task.
I only want this to occur in one catalog item only, so I cannot make any sweeping changes. I'm hoping to do this via workflow, or Catalog UI Policy or client script.
Any help would be appreciated 16:33
Cat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 12:43 PM
Hey @Cat,
I think you can use an Assignment Rule for this. It should work unless you are assigning the assignee through other capabilities such as a workflow.
- Navigate to Routing and Assignment > Assignment Rule
- Create a new record with the following:
Use your catalog item here instead.
The script will be something like:
//Find if there are previously closed tasks under same RITM
var scTaskGr = new GlideRecord('sc_task');
scTaskGr.addEncodedQuery('request_item=' + current.getValue('request_item') + 'active=false^assigned_to!=NULL');
scTaskGr.orderByDesc('sys_created_on');
scTaskGr.setLimit(1);
if (scTaskGr.next()) {
current.assigned_to = scTaskGr.getValue('assigned_to');
}
Hope it helps, cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 01:28 PM
This looks like you may be onto something! Let me quickly give this a go, and I'll report back!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 01:47 PM
Unfortunately that didn't work for me. Thanks for giving it a go though!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 04:30 PM
No worries, do you mind sharing how you are creating these tasks?
And when you say it didn't work, was it because the 'assigned to' field was blank or assigned with someone else?