RITM approval is changing to Rejected from Approved when the related tasks are closed skipped / closed incomplete

Roxi1
Tera Contributor

Here we have an issue in RITM, when the RITM already approved and when the child task is closed incomplete then RITM state will be closed incomplete. but Approval is setting as Rejected. because of this rejected notification is triggering.

can someone help on this 

this is the script have in the workflow on the last activity before END activity which will set the values based on task

var c_task = new GlideRecord('sc_task');
c_task.addQuery('request_item', current.sys_id);
c_task.query();

if (c_task.next()) {

var req = current.request.getRefRecord(); 


if(c_task.state == 3)
{
current.state = 3;
current.stage = 'complete';
current.approval='approved';
req.state = 3;
req.update();
}
else if(c_task.state == 4)
{
current.state = 4;
current.stage = 'Request Cancelled';
req.state = 4;
current.approval='approved';
req.update();
}
else if(c_task.state == 7)
{
current.state = 7;
current.stage = 'Request Cancelled';
req.state = 4;
current.approval='approved';
req.update();
}


}

1 ACCEPTED SOLUTION

Anil Lande
Kilo Patron

Hi Roxi,

There is out of the box business rule "reject approval on closed incomplete" on Requested Item <sc_req_item> table. This BR is responsible for your issue, it set approval as rejected when any RITM is closed Incomplete.

You need to make required changes to this OOB BR.

1. Disable it by setting active=false and create a duplicate BR and make required changes like adding condition so that it will not run for your catalog item.

2. If you don't want this behavior for all catalog items then simply deactivate it. 

 

 

Please mark helpful and correct answer if this resolves your issue.

Thanks,

Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

2 REPLIES 2

Anil Lande
Kilo Patron

Hi Roxi,

There is out of the box business rule "reject approval on closed incomplete" on Requested Item <sc_req_item> table. This BR is responsible for your issue, it set approval as rejected when any RITM is closed Incomplete.

You need to make required changes to this OOB BR.

1. Disable it by setting active=false and create a duplicate BR and make required changes like adding condition so that it will not run for your catalog item.

2. If you don't want this behavior for all catalog items then simply deactivate it. 

 

 

Please mark helpful and correct answer if this resolves your issue.

Thanks,

Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Roxi1
Tera Contributor

Excellent Anil, Got it . will take change accordingly Thanks Much