- 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: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
08-02-2023 02:50 AM
Hi Aman,
your solution works perfect but i have an additional requirement.
if there is no task created yet it should not be possible to move the state to Testing state, how can i add this to the current script ?
*the first task gets created from the ready for testing state so it should not be possible to move a story from draft/ready/work in progress

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 04:16 AM
I would suggest instead of adding more logic to it, why don't you restrict users to be able to move from Draft/Ready/WIP to closed.
In the same BR, just check with an overall if condition, something like
if(current.state.changesFrom(<state of ready>) || current.state.changesFrom(<state of WIP>) ||current.state.changesFrom(<state of Draft>) ){
}
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 05:03 AM
hi Aman,
i got it fixed by adding an Else condition into my exisiting script, this resolves my requirement.
thanks!