Add fix version to 99 issues

I have a filter which includes 99 issues. They all have fix versions set (one or more) and now we want to add a common fix version to theses issues. Add - which means that we want to keep the existing fix versions. If I use the bulk edit functionality the old versions will be replaced by the new.

(How )can this be done without doing it manually for each issue?

4 answers

1 accepted

0 votes
Accepted answer

you could use the csv-importer to achive this. The file needs to look like this.

id, Summary, FixVersion, FixVersion, FixVersion
xx-1,"First issue", v1, ,
xx-2, "Second issue", v2, ,
xx-3, "Third issue", v1, v2, v3
for details please see here

Udo, do you mean I need to first export and then import? Will that not replace? Can I do this and only get an update of the issue you mean?

Hi Susanne,

yes, export Issuekey, summary and fixVersion and then edit the csv (add your new version) and reimport the csv. It will do updates to the fields (only on fixVersion ) issuekey and summary are not affected but required

Cool, thanks. I will try this.

Glad I could help.

Thank you Udo! This work well in test and now I will do this in production.

You can use the following Script Runner script to add versions to a JQL search.

import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.bc.JiraServiceContextImpl
import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.index.IssueIndexManager
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.project.version.VersionManager
import com.atlassian.jira.util.ImportUtils
import com.atlassian.jira.web.bean.PagerFilter

String jql = 'project = TIQA and priority = Critical'
String projectKey = 'TIQA'
String newVersion = '1.35'

IssueService issueService = ComponentAccessor.getIssueService()
VersionManager versionManager = ComponentAccessor.getVersionManager()
ProjectManager projectManager = ComponentAccessor.getProjectManager()
IssueIndexManager indexManager = ComponentAccessor.getIssueIndexManager()
User user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
log?.debug "..Got user $user"

issues = getFilterResult(jql,user,log)
projectId = projectManager.getProjectObjByKey(projectKey)?.id
newVersionId = versionManager.getVersion(projectId, newVersion)?.id

if (newVersionId) {
        iiparams = issueService.newIssueInputParameters()
        iiparams.setRetainExistingValuesWhenParameterNotProvided(true, true)

        List versionIds = it.getFixVersions()*.id
        versionIds << newVersionId
        iiparams.setFixVersionIds((Long[]) versionIds.toArray())
        vresult = issueService.validateUpdate(user,, iiparams)
        if (vresult.isValid()) {
            uresult = issueService.update(user, vresult, EventDispatchOption.DO_NOT_DISPATCH, false)
            if (uresult.isValid()) {
                boolean wasIndexing = ImportUtils.isIndexIssues();
            } else {
                log.error uresult.getErrorCollection().getErrors()
        } else {
            log.error vresult.getErrorCollection().getErrors()

List<Issue> getFilterResult(String jqlSearch, User user, log = null) {
    SearchService searchService = ComponentAccessor.getComponent(SearchService.class);

    def ctx = new JiraServiceContextImpl(user)
    log?.debug "..Got ServiceContext $ctx"
    List<Issue> issues = null

    SearchService.ParseResult parseResult =  searchService.parseQuery(user, jqlSearch);
    if (parseResult.isValid()) {
        def searchResult =, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())
        issues = searchResult.getIssues()
        log?.debug "Found ${issues.size()} issues...\n"
    } else {
        log?.error("Invalid JQL: " + jqlSearch);
    return issues

You have to change jql, projectKey and newVersion to match your situation. Please try on a test system first. :-)


Thanks! I will look into this.

I haven't tested this specifically, but let's say you now have sprint 1, 2, 3 and 4 as versions. If you create version 1.0, and make those sprint versions "children" under version 1, I believe all of them will keep the initial sprint (e.g. 1, 2, 3 or 4) and at the same time be tagged with version 1 in the fix verison field.

Thanks for your quick respons. Children? I am not talking about sprints, only versions and as far as I have seen there is no "tree" functionality for versions or have I missed something.

Are you using Greenhopper? In Greenhopper a version can have a "parent" version, see here for some info:

If you have parent-child hiercarchy, the fix version will automatically include both versions (e.g. both parent and child version).

Sprint was just a example. You could have v.0.1, v.0.2, v.0.3, v.04 and then make version 1.0 the parent of them all.

JIRA Command Line Interface using something like:

--action runFromIssueList --search " <some JQL> " --common "--action updateIssue --issue @issue@ --fixVersions v1 --append"

Thanks Bob! This might also be useful.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,154 views 5 10
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