Scriptrunner Behaviour not dynamic

Apologies I didn't know how best to work the title, hopefully I can explain better below: 

 Essentially I have some code below: 

def dropDown = getFieldById("customfield_10052")

log.debug("dropdown value" + dropDown.getValue())

if (dropDown.getValue() == "Art") {
dropDown.setError("cannot choose art here")
} else {


 I am essentially checking a custom field for if its value is Art and choosing to display an error message if it is. 

My problem is, if the user ever simply selects Art even with the intention of later selecting something else, the error message shows and wont go away, even if the user selects a different value. 


Is there something I could do within the else to remove the error message/ re initialize the form? 


Many thanks for the help. 

1 answer

1 vote
Alexey Matveev Community Champion Nov 02, 2017


Change the if part to this

if (dropDown.getValue() == "Art") {
dropDown.setError("cannot choose art here")
} else {


Hi Alexey, 


Thank you so much, that worked.I should say I also discovered the method: 


 You absolutely pointed me in the direction for that, many thanks!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

456 views 7 5
Join discussion

Atlassian User Groups

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!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you