Cannot set issue resolution

Hello,

I use JIRA 5.1.6 and need to modify resolution for some issues by using groovy script. My code looks like

issueId = "ABC-123"
Issue issue = issueManager.getIssueObject(issueId)
..
..
newIssueResolution = issueSubTask.getResolutionObject()
issue.setResolutionObject(newIssueResolution)

boolean wasIndexing = ImportUtils.isIndexIssues()

// be sure indexing is on

ImportUtils.setIndexIssues(true)

issueIndexManager.reIndex(issue)

ImportUtils.setIndexIssues(wasIndexing)


System.out.println(issue.getKey() + " HAS NEW " + issue.getResolutionObject().getName() + "  resolution")

and in the JIRA logs i can see that println returns correct NEW resolution, but in JIRA issue still has OLD resolution.

Could you please advise what is wrong here?

Thank you.

Cheers, Georgiy

1 answer

1 accepted

This widget could not be displayed.
Henning Tietgens Community Champion Oct 16, 2012

You have to call issue.store() after updating the issue, before reindexing. BTW the issue class should be MutableIssue if you want to modify the issue.

Henning

issue.store()

is what I've been missing :)

Thank you very much!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

514 views 3 18
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