I would like to know the Jelly Tag to delete an issue from a project. I looked at the following link, http://confluence.atlassian.com/display/JIRA044/Jelly+Tags and cannot find the correct Jelly Tag.
Jira does not provide a Jelly tag to delete issues. You have to code that the hard way like the example here to delete issue MYPROJECT-6330. Of course some things are still missing here, e.g. checking the validation result and the error collection that is returned by issueService.delete.
<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log"> <!-- Grab managers. Do it using ComponentAccessor now which gives better compatibility in Jira 5! r --> <core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getIssueManager" var="issueManager"/> <core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getIssueService" var="issueService"/> <!-- Get users authentication context --> <core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getJiraAuthenticationContext" var="authenticationContext"/> <core:invoke on="${authenticationContext}" method="getLoggedInUser" var="user"/> <!-- Get the Issue from IssueManager --> <core:invoke on="${issueManager}" method="getIssueObject" var="issue"> <core:arg type="java.lang.String" value="MYPROJECT-6330"/> </core:invoke> <log:warn>Issue of ${issue.class} found</log:warn> <log:warn>User of ${user.class} found</log:warn> <core:invoke on="${issue}" method="getId" var="issueId"/> <core:invoke on="${issueService}" method="validateDelete" var="deleteValidationResult"> <core:arg value="${user}"/> <core:arg value="${issueId}"/> </core:invoke> <core:invoke on="${issueService}" method="delete" var="errors"> <core:arg value="${user}"/> <core:arg value="${deleteValidationResult}"/> </core:invoke> <log:warn>deleted</log:warn> </JiraJelly>
Is there a way to automate this script and execute it against a filter results that include the list of issues to be deleted?
Thanks,
Yaron
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This question is duplicated here:
https://answers.atlassian.com/questions/45238/jelly-script-to-delete-an-issue
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.