Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Whatever I change the catalog task state it first updates to closed complete then closed incomplete

Prasun Sarkar7
Tera Expert

Hi facing an issue whenever the catalog task is updated the ritm updates are first closed complete then closed incomplete.

PrasunSarkar7_0-1761229064115.png

PrasunSarkar7_2-1761229084988.png

 

 

9 REPLIES 9

Hi @Prasun Sarkar7

If you suspect its a BR thats causing this theres a couple of things you can do. 
You can go to BR's configured on sc_req_item table - filter on active = true and see which ones are impacting state. 
Or you could jump into debugging - here's the ServiceNow documentation on that: Debugging business rules

Hmmmm this bug is raised as priority when I am updating stage via flow then the state is always changes to completed but via background script when I am updating its not updating the state

Looking at the screenshots of your flow, your if condition in step 13 is not evaluating accurately or is not evaluating what you think it is. This is unlikely to be a BR issue as it would have to be changing the value while your flow is running and you would thus see an additional system step in the change activities.

Per the run you show its evaluating something equal to completed but based on other screenshots it appears your should be evaluating the field you set to Closed Complete.

This suggest to me that either you are not checking the value of the correct field on the task or the value you are checking is not being updated in the manner you expect and thus the condition is always evaluating to false resulting in your step 15 and 16 always running and setting the "Closed Incomplete" value.

Hey John the if conditions are working fine I checked but the thing is that when I add the step called stage between the lines to COmpleted or Closed Incomplete the state of the RITM always updates to completed. But when I do update via script the state of the RITM is not changed

This sounds like an issue with your script if I'm interpreting you correctly. The script could be encountering an error and not actually completing the update or there could be a timing issue where the flow execution proceeds before the scripted update is complete.

I would debug the script first to make sure it is actually running successfully and completing the update in your specific scenario/configuration. Once you verify that then if the issue is persisting you would need to evaluate if the flow is acting correctly. If your script is a background script it may not be triggering the flow as expected or the flow itself may be running without awareness of the script and thus proceeding faster than the script and getting to that point before the scripted update is applied.