Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Issues from released fixVersions shouldn't be reopened

T I
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2013

Hi, is there a way to make issues from already released fixVersions unable to be reopened?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Justin Alex Paramanandan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2013

Hi @Tomasz,

It is possible to perform such a task; with the usage of the Groovy Script Runner plugin. I created the following script:

import com.atlassian.jira.issue.Issue
import com.opensymphony.workflow.InvalidInputException

// loop all versions
for (int i = 0; i < issue.getFixVersions().size(); i++) {
    if ((issue.getFixVersions().get(i).released)) {
        //Only execute if the fix version is released
        invalidInputException = new InvalidInputException("assignee", "Issue could not be reopened. Version \"" + issue.getFixVersions().get(i).name + "\" has already been released.")
        break;
    }
}

I saved this script as checkVersionIsReleased.groovy and placed it inside the $JIRA_INSTALL/bin/groovy-scripts directory (can be any directory, but it would have to be in the $JIRA_INSTALL/bin directory).

Once this has been done, I edited the Reopen Issue transition in my workflow to include this script as a validator:

And, when I tried to reopen an issue with a fix version that has already been released, the script will block me from reopening it:

The script above may be a bit rough off the edges, but I just came out with it in just a short time. It works for me, but may be some adjustments to the code? :)

Hope this helps!

T I
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 18, 2013

Thought there would already be a JIRA function for this.

Thanks for the script. I'll try it.

T I
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 18, 2013

Worked perfectly!

TAGS
AUG Leaders

Atlassian Community Events