Jira: How to Restrict Resolution options according to transition being performed

Hi,

We have a need to restrict the options available for the resolution field accrding to the action being performed. E.g. we have an action "Close - no fix", for which the options are "Functions as Designed", "Won't Fix", "Cannot reproduce". Other actions allow values such as "Fixed" etc.

In our Jira 4.0.1 instance this is implemented using javascript code in the description of the Resolution field as follows:

if (document.location.href.match(/.*CommentAssignIssue.*/)) {
res_box = document.getElementById('resolution');
if (document.location.href.match(/.*action=121(\D|$).*/)) {
removeAllOptions(res_box);
addOption(res_box, "Fixed", 1);
} else if (document.location.href.match(/.*action=41(\D|$).*/)) {
removeAllOptions(res_box);
addOption(res_box, "Functions as Designed", 7);
addOption(res_box, "Cannot Reproduce", 5);
addOption(res_box, "Won't Fix", 2);
}

}

function removeAllOptions(selectbox) {
var i;
for(i=selectbox.options.length-1;i>=0;i--) {
selectbox.remove(i);
}
}

function addOption(selectbox,text,value ) {
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}

The complete script has been reduced here for brevity.

We are in the process of upgrading our Jira system to a later version and have found this no longer works (I have tried in Jira 5.0 & 6.0). Please could somebody suggest how to implement this in 5.0 or later.

Thanks,

Martin.

1 answer

1 accepted

you can restrict the resolution option by using workflow properties,

add the following propety on transition properties as key values

jira.field.resolution.include =1,2,3

1,2,3 is the id's of the resolutions

check this doc

https://confluence.atlassian.com/display/JIRA/Workflow+properties

and also @jobin explained well about workflow properties here

http://www.j-tricks.com/1/post/2011/02/permissions-based-on-workflow-status.html

Thank you for the answer. This works perfectly.

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 yesterday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

59 views 0 5
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