In our environment, users are NOTallowed to move an issue from DONE to the previous statuses. But, when they accidently do it, I want to run a script to move the issue back to the previous status say 'In Progress".
I am able to move the status back successfully, but the Resolution of the issue still shows as "Done" . . How do I change it to None or "Unresolved"
Below is a snippet of my code for clearing the Resolution:
def issueService = ComponentAccessor.getIssueService()
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def issueInputParameters = issueService.newIssueInputParameters()
issueInputParameters.addCustomFieldValue(IssueFieldConstants.RESOLUTION, null)
def validationResult = issueService.validateUpdate(currentUser, issue.id, issueInputParameters)
if (validationResult.isValid()) {
issueService.update(currentUser, validationResult)
} else {
return "Failed to clear resolution: ${validationResult.errorCollection}"
}
Hi,
try to get the issue as a mutableIssue, that will allow you to set the resolution
MutableIssue (Atlassian JIRA 7.6.1 API)
Was able to figure out !
I kept using issueService and tried to rest the resolution via the IssueInputParameters and it did not work.
So instead cleared the resolution directly from the MutableIssue object
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.