How do I set a status based on the resolution field?

Jeff Lee January 26, 2014

Hi,

I'm wondering how I can set the status based on the Resolution value a user chooses from a "Resolve" transition. For example, I have Resolution values of "Won't fix" and "Code Complete" and I want the issue to transition to two different statuses based on which one they choose. I can't seem to figure out how to easily accomplish this using transitions.

thanks,

-Jeff

2 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 26, 2014

The short answer is that you don't.

A transition has a single end point, a fixed status. You can't change it. If you dig back through Answers (and their predecessor fora if they still existed), you'd find this question crop up a few times, and then you'd find a lot of people trying to change the end status in post-functions and bascially trashing their issues. Frankly, I've been paid quite a lot of money for unpicking the total mess people have made when they've tried changing the end-point during the transition. Much as I'm grateful for the opportunity of work, I have to say: "It. Does. Not. Work."

There are four basic approaches to working around it.

1) The JJupin plugin has a neat trick which makes it look like you've done this. It doesn't really do it, but it's so close, you won't care.

2) The usual trick is to create several transitions and block off the ones you don't want based on the field logic. Of course, this doesn't work for the cases where you're changing the data in a field during the transition (which is what you're doing)

3) The trick when 2 isn't appropriate is to have one transition to the "won't fix" status you want. Then create a transition from there to the other possible landing point. Then find or write a "listener" which catches the transition into "won't fix", runs your business logic (i.e. "is this actually code complete?") and if appropriate, triggers the second transition.

4) Have two transitions and set the resolution for the user instead of relying on the resolution to set the end point. (i.e. What Joe said)

0 votes
Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 26, 2014

JIRA isn't designed to work that way. You set the resolution during a transition, so by definition you've already selected which status you'll end in because there isn't an option to have multiple exits from a transition. One option would be to have multiple transitions named after the resolution you want to set and automatically set the resolution when executing the transition.

Suggest an answer

Log in or Sign up to answer