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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

165 views 0 4
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