RITMS getting closed incomplete, apprpoval of RITms getting rejected when Request Approval is reject

Annirnita Dash1
Tera Contributor

Hello Folks,

Please help me to know why the related RITMs of a single request gets "closed incomplete" and its approval field  gets rejected (even when they are in OPEN) when the REQ's state is Closed incomplete and approval is rejected. 

It OOB configured somewhere.

 

I have a requirement where I need to set the REQ "approval" as rejected, stage as "closed cancelled", state as " "closed incomplete" even  when 

Request is having multiple RITMs and Any one RITM 1 is Closed Incomplete and RITM 2 is Open.

Upon trying to achieve this, I was setting "REQ" approval as rejected when any RITM's approval is rejected and got all related RITM as closed incomplete.

Please help if anyone can understand this use case.

 

1 ACCEPTED SOLUTION

@Annirnita Dash1 

there is some custom flow or business rule which is doing this.

Ideally if it's OOB then it should only impact the RITM for which the approval was rejected under that REQ and not the other RITM under the same REQ

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

10 REPLIES 10

@Annirnita Dash1 

REQ will get auto approved if your item price is less than USD 1000 I believe.

What's your requirement to reject that?

I don't think the below is OOB

Please help me to know why the related RITMs of a single request gets "closed incomplete" and its approval field gets rejected (even when they are in OPEN) when the REQ's state is Closed incomplete and approval is rejected.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hello Ankur,

When an approver manually rejects a RITM, the approval present in the request associated to it shall change the value to "rejected" same like RITM. But in case if we have multiple RITMs and others are open, then thosse shall retain the state as open and approval (depending on the RITMs Approval value).

Here upon making changes in requests approval (as rejected), it is rejecting apporvlas and making state as closed incomplete of all associated RITMS which are on open state.

@Annirnita Dash1 

there is some custom flow or business rule which is doing this.

Ideally if it's OOB then it should only impact the RITM for which the approval was rejected under that REQ and not the other RITM under the same REQ

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hello Ankur,

I guess I could not explain you. Accepted the solution by mistake.

I have written a BR, after update. Where if RITM's approval is rejected, the REQ approval shall get rejected. But I need to know if REQ's approval is rejected how come it is making all the related RITMs  apporval as rejected and state as closed incomplete(in case of multiple RITMs). There might be some OOB code which results in making these related RITMs approval as rejected and state as closed incomplete when REQ has same rejected and closed incomplete.

 

BR I wrote:  (after update)

 

var req1 = new GlideRecord('sc_request');
    req1.addQuery('sys_id', current.request);
    req1.query();
   
    if(req1.next())
    {
    if(current.state == 4 || current.approval == 'rejected')
            {
            req1.approval = 'rejected';
           
        }
            req1.update();
    }

@Annirnita Dash1 

yes I believe some other OOB or custom business rule is doing that

you can use script tracer to debug more

Script Tracer and debugging scripts 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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