When RITM gets cancelled on Portal, REQ is not getting updated with correct request state of "Closed Cancelled"

mkader
Kilo Guru

Hello,

I am trying to fix a problem a user is currently having but am unable to figure out the issue. When I change the state of a RITM to "Closed Complete", the REQ automatically gets updated to "Closed Complete". When I try to cancel a RITM on the Portal, the REQ state does not change and stays in the "Approved" request state. There is an OOB BR that handles the REQ when the RITM's status gets modified "Close Parent if Required". How can I modify the OOB BR to change the state of the REQ to match the RITM if the RITM been cancelled?

Thanks!

1 ACCEPTED SOLUTION

I was able to figure out what was going on. I soon found out that we did not want to modify the OOB functionality of the BR's or workflows, so I modified our custom workflow. The code you provided fixed the issue with the addition of modifying another OOB BR on the request table. THanks!

View solution in original post

9 REPLIES 9

Allen Andreas
Administrator
Administrator

Hi,

In that business rule...there is conditional statements that look for the stage of that item. Are you using custom stages?

current.stage.changes() && (current.stage=='complete' || current.stage=='Request Cancelled' || current.stage == "closed_incomplete" || current.stage=="closed_skipped")

So as you can see here, this BR only executes the associated code to close out parent if it meets the criteria above. If it doesn't...it doesn't run.

You'd want to adjust that accordingly.

I don't think the Portal is specific to this.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

@Allen A , When I look at the XML on a cancelled RITM, it shows the stage as fulfillment. Does that mean I need to modify the workflow? If I need to modify the workflow, Is there an OOB workflow that already exists on this (Sorry. I'm new to ServiceNow)? 

You were right about the Service Portal. The functionality works fine when the RITM is put into the "Closed Complete" status. The REQ gets updated. Passing "fulfillment" stage to the condition in the BR doesn't seem like the right way, or is it? 

Hi,

Yea, I wouldn't want to change it to also allow fulfillment, but you could have other workflows with stages after this and instead the BR would just end it there.

You'd want to go with the stages above, if possible. Or at the very least, add a custom one that makes sense for your organization.

I'm attaching a basic OOB request item workflow for you to review. You'll see what they did for the stages to give you an idea. Click the picture to see it bigger or right-click and choose open in new window.

find_real_file.png

 

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

@Allen A - This is the workflow I was just looking at and was about to modify. So would I just add more logic to the "Approval Action" in the bottom left on the "Request Cancelled" stage? or would I have to create another flow?