Forums

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

deleting attachment in jira automation

Anar Mahmudzada August 3, 2022

Hi experts,

I need to fix the jira automation which it should copy the attachments from parent issue (trigger issue) and paste to linked issues (is cloned by) then the attachments of the parent issue must be deleted.

Copying the attachments works well in the automation, but the deleting part gets error every time. It has to delete all the attachments from parent issue. When I use "delete attachment/all attachments" it does not work in the automation. Instead  of this I tried to use regular expression for the trigger issue, it gets wrong results or no action.

Could you please share your opinions regarding this issue?

I would be grateful if you could help me.

Thanks a lot in advance 

 

2 answers

1 accepted

4 votes
Answer accepted
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.
August 3, 2022

Hi @Anar Mahmudzada 

Based upon your rule image, I suspect you are encountering a timing problem (i.e. a racetrack error).

Automation rule branches which process one-and-only-one-issue (e.g. branch on epic parent) run in-line and complete before any other rule steps process.  All other branches run in parallel and asynchronously.  The impact for your rule is the first branch (on linked issues) is still running when the second one (on parent) starts/finishes.

Without seeing your entire rule, I suggest a solution may require a redesign of your approach.  If you post your entire rule the community may see some way to do this in one rule.

Another possible work-around that might help is divide-and-conquer using two rules:

  • use one rule to update the linked issues, and as the very last step of that rule, update the parent in some way to tell it to delete the attachments, but do not delete the attachments yet.  For example, adding a comment: "Automation requests delete all attachments"
  • use a second rule, triggered on the comment and with the "Allow Rule Trigger" option enabled, to perform the actual attachment delete

I note this only "might" work because there still could be timing issues.

Kind regards,
Bill

Anar Mahmudzada August 4, 2022

Hi,

Thank you so much for the explanation.

You are absolutely right that, divide-and-conquer using two rules is more efficient way. 

And I have fixed the problem.

Thanks a lot for your help.

Have a nice day!

 

Br/ Anar

Like Bill Sheboy likes this
0 votes
Anar Mahmudzada August 3, 2022

image.png

Suggest an answer

Log in or Sign up to answer