Hi
I have a requirement on jira.
I want to be able to automatically populate the fix version(s) field with the next unreleased version when the issue is moved to resolved.
How can we achieve this?
Rahul
Conditioned Workflow Functions for JIRA has a post function to update an issue and you can use the earliestUnreleasedVersion(projectKey) substitution variable to set the fix versions field.
You can write a Transition post function script for this using scriptRunner plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you've done this yourself could I see the script to copy it for myself please?!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The following sets it to a specific version based on the string passed when creating the Version... you should be able to modify this with the function Bob suggested to get what you're looking for.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.project.Project
import com.atlassian.jira.project.version.Version
import com.atlassian.jira.project.version.VersionManager
import com.atlassian.jira.event.type.EventDispatchOption
import org.apache.log4j.Category
Category log = log;
log.setLevel(org.apache.log4j.Level.DEBUG);
VersionManager versionManager = ComponentAccessor.versionManager
IssueManager issueManager = ComponentAccessor.getIssueManager()
Issue issue = issue
Project project = issue.getProjectObject()
Version versionFX = versionManager.getVersion(project.getId(), "no actual code")
issue.setFixVersions([versionFX])
issueManager.updateIssue(componentManager.jiraAuthenticationContext.getLoggedInUser(), issue, EventDispatchOption.DO_NOT_DISPATCH, false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The following sets it to a specific version based on the string passed when creating the Version... you should be able to modify this with the function Bob suggested to get what you're looking for.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.project.Project
import com.atlassian.jira.project.version.Version
import com.atlassian.jira.project.version.VersionManager
import com.atlassian.jira.event.type.EventDispatchOption
import org.apache.log4j.Category
Category log = log;
log.setLevel(org.apache.log4j.Level.DEBUG);
VersionManager versionManager = ComponentAccessor.versionManager
IssueManager issueManager = ComponentAccessor.getIssueManager()
Issue issue = issue
Project project = issue.getProjectObject()
Version versionFX = versionManager.getVersion(project.getId(), "no actual code")
issue.setFixVersions([versionFX])
issueManager.updateIssue(componentManager.jiraAuthenticationContext.getLoggedInUser(), issue, EventDispatchOption.DO_NOT_DISPATCH, false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In case, you might have multiple unreleased versions. How will you identify which one?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.