I want to set a resolution default value using the Bahaviours plugin

Our default resolution for JIRA is "Fixed", but I have a project in which I would like to set the deafult value of the Resolution field to "Review Completed". I am attempting to do this with theh Bahaviours plugin by including some simple server side code to a workflow transition. Here is what I have:

FormField myres = getFieldById("resolution")
if (myres.getFormValue() == "1") { 
    myres.setFormValue(7)
}

In the example above "Fixed" is value "1" and "Review Completed" is value "7". It works, except that I can never choose "Fixed" even if I wanted to.

What I realy need is a way to excute this only once with perhaps an onload or something, but it doesn't appear that Behavious has sunch an event.

2 answers

1 accepted

0 vote

You can't attach this behaviour to the resolution field - otherwise it will work as you say (as it should). Try attaching it to some field the user can't change in the form, for instance the issue type.

Wow...Fast answer! Some days I think my brain just doesn't work. Thanks so much. This works perfectly now.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

327 views 0 6
Read article

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