Jelly Script to delete an Issue

I would like to know the Jelly Tag to delete an issue from a project. I looked at the following link, and cannot find the correct Jelly Tag.

2 answers

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"/>
  <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 on="${issueService}" method="delete" var="errors">
    <core:arg  value="${user}"/>
    <core:arg  value="${deleteValidationResult}"/>


Is there a way to automate this script and execute it against a filter results that include the list of issues to be deleted?



The scripts at show how you can execute a sewuence of jelly tags against all issues matching a filter. You can also automate jelly scripts using the jelly service
See more at how to install the Jelly serice. You can get the name of the service implementation class from the source that is linked on this page
If the jelly script does not run in the jelly service and only if it is executed manually in the jelly runner, please make sure you login first as a user that has the right to delete issues. You can login using the jira:login tag as in

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Agile

What is Scrum? A good, bad, and ugly answer.

In a world of dark-scrum, faux-scrum, and scrum-butt, the question still remains: What is scrum and how do you do it “right?” That’s the question we set out to answer. I'm Max, I've been teaching c...

65 views 0 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you