Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation - How can I edit the children of a deleted epic?

Thanasis Nikolaou January 31, 2024

When deleting an epic, there is a field that requires editing in its children. Trying to use a branch "Children" OR "JQL" in combination with lookupIssues unfortunately doesn't work because while using a branch a "key != ({{triggerissue.key}})" is added in the backend of the branch so that it only returns related issues (not including the current issue).

A JQL with a deleted issue is not valid, hence the error. SD-902 is the deleted issue that triggers the rule in the snip attached.

Is there any other approach I could follow? :) 

Thanks in advance for any help!

Capture.PNG

2 answers

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2024

Welcome to the Atlassian Community!

If you delete an issue (Epic) then it is gone, completely.  (The standard recommendation is that you should never allow anyone to delete an issue.  Invalidate it, move it to a status that means "needs no more attention", or even move it into a "trash" project, but never delete)

You cannot work with data that no longer exists.  There is no way you can search for something that no longer exists and expect to get any results.  

You might be able to make this work if the automation is run as part of the "Epic deleted" process, but I'm not sure the issue deleted trigger will contain enough information about the Epic to identify all its children.

If that does not work, the best thing to do is disallow issue delete, and set up a trash project you can move the issues you want to delete into.  Use that move as the trigger for your automation.

For your existing issues that have had their epic deleted, I don't think there's any way to automate anything.  You'll have to manually read their issue history to see where their epic-link/parent was removed.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2024

Hi @Thanasis Nikolaou -- Welcome to the Atlassian Community!

Yes, and...agreeing with Nic's suggestions on disabling issue deletion, and...

By the time the Issue Deleted trigger fires for a rule, the issue is gone and the links to the child issues are cleared.  Although the rule has the deleted issue's key, that cannot help for finding the child issues (as you observed with JQL).

And...I do not believe the Issue Updated or Issue Field Updated triggers can be used to accurately detect the clearing of the parent field to find the children.  Seems to be either a timing issue or a difference in which events are fired.

Kind regards,
Bill

Like Nic Brough -Adaptavist- likes this
Thanasis Nikolaou February 7, 2024

Thank you both - very helpful answers

You are right, the "issue updated" does not get triggered when the parent field gets emptied as a result of a deletion. It's not even captured in the history of the story, which doesn't make sense to me...

Maybe a scheduled automation to find children with no parent will do for now.

Thank you both!

Like # people like this
0 votes
Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2024

I am not understanding what you are trying to do.

is SD-902 already deleted before the "branch"? why?

Please post picture of your actual rule in your original post along with details on what are you trying to do to "children" so folks can help.

Thanasis Nikolaou February 7, 2024

SD-902 (Epic) Deleted by a user. Then using a branch to reach its children and clear some field values that shouldn't exist in stories without epic.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events