There is one strange behaviour I am observing in the workflow conditions.
I have a workflow button called 'Modify', I would like to show this button only in certain conditions.
I have written a groovy file which return either true or false. If the return value is true the button will be visible where as if it is false the button will be hidden from the user.
Now the problem here is, if I put this code directly in the simple scripted condition, everything works perfectly. Where as if I put this code in a file and refer that file path in a script condition this code is not working, the button is visible even if the groovy file returns false.
I checked that the groovy script is running in both the cases though.
Is it a bug or expected behaviour. Since the script is quite long, I would prefet it to be kept in a file and referenced rather than directly putting it on the screen.
Steps to Reproduce this:
1. Take one simple workflow, with a transition called Modify
2. Add a condition --> Script Condition --> Simple Scripted Condition-->return false
The Modify button will be hidden
3. put return false in a groovy file, refer it in the conditon
Add a condition --> Script Condition -->Give file path in Script File Path
The Modify button will be still visible when you run the code
JIRA Version - 6.0.6
Script Runner Version - 2.1.11
I think you're comparing "Simple scripted condition" with writing a custom condition (understably confusing).
For a file you should use:
passesCondition = false
Simple scripted condition just aimed to make simple one-liners easier. Hopefully it's clearer in 3.0, where everything can be either inline or in a file.
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG