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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.