SC_Task Business Rule

liamregan5
Tera Contributor

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. 

5 REPLIES 5

Prasad Dhumal
Mega Sage
Mega Sage

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?

Ankur Bawiskar
Tera Patron
Tera Patron

@liamregan5 

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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

Basheer
Mega Sage

Hi @liamregan5 ,

In the Business rule make a condition stating the state is not closed completed.

 

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.