- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 01:59 AM
Hi,
im trying to prevent the state from moving to Testing or Complete if a scrum task is still open.
i created this script, its displaying the message so thats work but it doesnt keep it in the Ready for testing (-7) state when you refresh the page.
what am i missing?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 02:14 AM
Hi @jean-pauldehaas ,
Hope you are using Before Update BR.
And condition should be State changes to Complete OR Testing.
You do not need to explicitly set the state as -7, setAbortAction will be sufficient here. No need of setWorkflow as well.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 02:23 AM
Check response shared by Aman and share us the updates.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 03:08 AM
There are a few reasons why state might not be saved in a React application. Here are some of the most common ones:
The setState() method was not called. This is the most common reason why state is not saved. The setState() method is used to update the state of a component. If the method is not called, the state will not be updated.
The setState() method was called with an invalid argument. The setState() method takes an object as an argument. The object must contain the key-value pairs that you want to update. If the object is invalid, the state will not be updated.
The setState() method was called too often. The setState() method can be called multiple times, but it is important to call it at a reasonable rate. If the method is called too often, the state may not be saved.
The setState() method was called from a component that is not mounted. A component is mounted when it is first rendered. If the setState() method is called from a component that is not mounted, the state will not be saved.