I'm trying archive an issue via MyGroovy plugin and I found this code in the community:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.archiving.ArchivedIssueService
@StandardModule
ArchivedIssueService a
def authContext = ComponentAccessor.getJiraAuthenticationContext()
//issue = ComponentAccessor.getIssueManager().getIssueObject("TESTISSUE-1234")
def validationResult = a.validateArchiveIssue(authContext.getLoggedInUser(), issue.getKey());
if (validationResult.isValid()) {
a.archiveIssue(validationResult);
}
But when I put this code in the Console, this error appears:
How can I fix it ?
Hi @Rafael Costa ,
that method is not more available depending on JIRA version.
Btw, try this one :
validateArchiveIssue(ApplicationUser user, String issueKey, boolean notifyUsers)
def validationResult = a.validateArchiveIssue(authContext.getLoggedInUser(), issue.getKey(), false);
So you need a boolean as last parameter of your call. More information available here
This should fixs your issue,
Fabio
Thaaanks Fabio it's still works here!
More a doubt: What means @StandardModule in this script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rafael Costa ,
@StandardModule is an annotation that imports ArchivedImportService module in your script.
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online 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.