# Transition Condition Script Returns false but Transition is Still Available

**URL:** <https://forum.library.adaptavist.com/t/transition-condition-script-returns-false-but-transition-is-still-available/436>\
**Category:** ScriptRunner\
**Tags:** condition, data-center, post-function\
**Created:** [February 25, 2024, 7:46pm UTC](https://forum.library.adaptavist.com/t/transition-condition-script-returns-false-but-transition-is-still-available/436 "2024-02-25T19:46:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![candrade](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@candrade](https://forum.library.adaptavist.com/u/candrade)\
**Post date:** [February 25, 2024, 7:46pm UTC](https://forum.library.adaptavist.com/t/transition-condition-script-returns-false-but-transition-is-still-available/436/1 "2024-02-25T19:46:14Z")

</div>

I added a condition to a transition using the custom script condition option [ScriptRunner], but the transition is still available on the issue screen. I simplified the script to just “return false” to make sure but the transition still shows up. What could be causing this problem?

---

<div class="post-metadata">

**Author:** ![imadero](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/imadero/32/59_2.png) [@imadero](https://forum.library.adaptavist.com/u/imadero)\
**Post date:** [February 26, 2024, 9:36am UTC](https://forum.library.adaptavist.com/t/transition-condition-script-returns-false-but-transition-is-still-available/436/2 "2024-02-26T09:36:10Z")

</div>

Hi,  
Well, there is a few things that can happen.

- The workflow you are updating is incorrect, and the issue is using another workflow.
- You are not publishing the changes, and are in draft, which means those changes are not being executed.
- The transition could have more than one path to get to the same status, and this could lead to even when one condition is working fine, another transition leading you to the same status.

Let me know if some of those things help, and if not, please try to share how you have configured your condition and the workflow configuration to try to solve the problem.  
Thanks, Ivan.

---

<div class="post-metadata">

**Author:** ![candrade](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@candrade](https://forum.library.adaptavist.com/u/candrade)\
**Post date:** [February 26, 2024, 1:39pm UTC](https://forum.library.adaptavist.com/t/transition-condition-script-returns-false-but-transition-is-still-available/436/3 "2024-02-26T13:39:54Z")

</div>

Thanks for the reply Ivan! I double check all of those possibilities. I made sure the workflow was the one the issue is using, to publish the workflow after every change, and that there was only one path to that status, but the problem persists.

This is how I set the condition: I clicked on “Add Condition” on the transition, selected Custom script condition [ScriptRunner], my script is one line “return false” but the issue is still available.

I also tried this is a different project with a different issue type just to make sure, but the transition also shows on the issue screen.

Thanks!

---

<div class="post-metadata">

**Author:** ![candrade](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@candrade](https://forum.library.adaptavist.com/u/candrade)\
**Post date:** [February 26, 2024, 6:47pm UTC](https://forum.library.adaptavist.com/t/transition-condition-script-returns-false-but-transition-is-still-available/436/4 "2024-02-26T18:47:35Z")

</div>

This is very strange. If instead of selecting “Custom script condition [ScriptRunner]”, I select “Simple scripted condition [ScriptRunner]”, the same script works as it should.

---

<div class="post-metadata">

**Author:** ![imadero](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/imadero/32/59_2.png) [@imadero](https://forum.library.adaptavist.com/u/imadero)\
**Post date:** [February 27, 2024, 9:03am UTC](https://forum.library.adaptavist.com/t/transition-condition-script-returns-false-but-transition-is-still-available/436/5 "2024-02-27T09:03:45Z")

</div>

Hi, I think your problem was the following.  
The custom script condition is quite different, you should set the passesCondition variable in the end to make the validation work

---

<div class="post-metadata">

**Author:** ![candrade](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@candrade](https://forum.library.adaptavist.com/u/candrade)\
**Post date:** [February 27, 2024, 1:10pm UTC](https://forum.library.adaptavist.com/t/transition-condition-script-returns-false-but-transition-is-still-available/436/6 "2024-02-27T13:10:31Z")

</div>

Thank you Ivan! That explains it. I missed that part.
