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 vote
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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

175 views 0 4
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