SC_Task Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 09:03 AM
Hi,
Would anyone be able to help with he below issue I am facing please?
We have a business rule set up to copy the assigned to and assignment group from the SC task to the RITM.
The issue occurs when a user is populating a name into the assigned to field and then close completing the task all in one single submission. The ritm then updates the assignment group to the assignment group from the new task created off the back of closing the previous, however it keeps the assigned to as the user from the initial task, instead of wiping the assigned to field on the RITM until the new task has the assigned to completed.
Is there something i should be adding to the business rule so that it wipes the assigned to field on the RITM in this instance?
As when the assigned to field is populated and form is saved, then it is closed completed and i don't have this issue.
Any help is appreciated, thanks all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 09:33 PM
Hello,
Have you tried adding a conditional statement in the business rule to check if the task is closed completed, and if so, clear the assigned to field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 09:39 PM
what do you mean by all in one single submission?
are you saying user is updating all catalog tasks at once from list with same assigned to user?
can you share screenshots?
share your script
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 12:43 AM
Hi Ankur, what i mean by one submission, is said users are assiging the catalog task to themselves not saving the form and just pressing close complete straight away, rule below:
(function executeRule(current, previous /*null when async*/) {
var grRITM = new GlideRecord("sc_req_item");
grRITM.get(current.request_item);
grRITM.assignment_group = current.assignment_group;
grRITM.assigned_to = current.assigned_to;
grRITM.update();
var grREQ = new GlideRecord("sc_request");
grREQ.get(current.request_item.request.sys_id);
grREQ.assignment_group = current.assignment_group;
grREQ.assigned_to = current.assigned_to;
grREQ.update();
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 09:41 PM
Hi @liamregan5 ,
In the Business rule make a condition stating the state is not closed completed.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.