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}"
}