This is my scenario:
I am closing an issue with groovy and I need to set the resolution to the issue. I don't want to use a post function because the issues being closed are the result of a JQL.
def query = ..... //query that returns issues
def user = userManager.getUserByName(//some user)
def results = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter())
def issues = results.issues.collect {issueManager.getIssueObject(it.id)}
def issueResolutionConstant = constantsManager.resolutions.findByName("Done")
IssueInputParameters param = issueService.newIssueInputParameters();
issues.each{ issue ->
//I then have code that checks if the transition is valid which works and changes the status to "Complete"
param.setResolutionId(issueResolutionConstant.id) //THIS IS WHAT I NEED HELP WITH
@Vivian Escalante you'll want to use something like this
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.config.ResolutionManager def resolutionManager = ComponentAccessor.getComponent(ResolutionManager) if (! issue.getResolutionObject() ) { issue.setResolution(resolutionManager.getResolutionByName("Done")) }
Where are you trying to execute this script?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.
Learn moreOnline 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.