When i delete a story, I need the linked issues deleted too. Is this possible with Automation for JIRA?

Andreas Knecht Community Champion Jan 08, 2017

When a story is deleted, I want all linked issues deleted too, however this doesn't seem to work since when a issue is deleted, the reference of the linked issues is lost.  Is there a way this can be done with Automation for JIRA?

1 answer

1 accepted

0 votes
Accepted answer
Andreas Knecht Community Champion Jan 08, 2017

So ideally the Automation rule for this would simply be:

  • Trigger: Issue deleted
  • Action: Related issues (linked issues)
    • Action: Delete issue

However in practice this doesn't work, since the 'Issue deleted' trigger arrives after the issue has been deleted and removed from JIRA's search indexes.  In order to find the linked issues we have to run the query 

issue in linkedIssues("<DELETED_ISSUE_KEY>")

which of course fails, because no issue with the key of the deleted issue can be found any more.

There is one work-around though using Manual Triggers.  You can setup a rule as follows:

Project automation - Code Barrel JIRA 2017-01-09 08-32-54.png

So this uses a manual trigger which adds an action on the view issue page called 'Delete linked issues' (in Cloud this will be in the 'Automations' panel on the right. In server it's part of the view issue operations).  It then goes and deletes the linked issues first and only after that's done will it delete the current issue from which you triggered the action!

It's not ideal since there's 2 ways of deleting an issue now, but there's not much else we can do to work around this. It's simply how JIRA works.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

440 views 8 26
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