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

0 vote
Dieter Community Champion Mar 30, 2012

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?



Dieter Community Champion Oct 10, 2012
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
Dieter Community Champion Oct 10, 2012
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
Dieter Community Champion Oct 10, 2012
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 Join to answer
Community showcase
Jason Wong
Published Tuesday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

464 views 8 16
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot