Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to automatically remove attachments

Katerina Bohacova
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 25, 2023

Hi, I am creating various rules to adjust my board. I have managed to automatically remove due dates and labels. However, I have not managed to create a rule automatically removing attachments. It is not an available option in the "add/remove" section of a new rule, or anywhere else. Can you please help me find it?

Thanks a lot, Katerina

2 answers

1 vote
Kyle Hatch
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 30, 2023

Hello, I would also like to support this request. We have cards for monthly supply orders that we attach a supply order list to. It would be nice when completing the card that it would automatically delete the attached old supply order list in addition to changing the due date and clearing the checklist. Thanks!

Sal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 30, 2023

Hi @Kyle Hatch! Thanks for your interest in this feature! I'll add your feedback as +1 to our internal feature request and bring visibility to your interest in having this option on Automation. Thanks for your understanding! 

0 votes
Luciana Munhoz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2023

Hi Katerina! Welcome to the community!

I did some testing in here, but I couldn't find a way to directly remove an attachment like for labels and due dates. There's a way to use the attachment link.

So I tested an alternative that might help in your case. For that, I had to create 2 rules and use a custom field (available in Premium). Here it goes: 

1 - Create a rule that when an attachment is added to a card, fill out the custom field with the attachment link. For that, I used the variable -> {attachmentlink}

when an attachment is added to a card, set custom field "Attachment link" to "{attachmentlink}"
2 - Create a rule with a trigger (in this case I used a label to trigger an action) that will look for the attachment link in the custom field and remove the attachment from the card. Here used the variable {{%Custom Field name}}
when the blue label is added to a card, remove link "{{%Attachment link}}"
image (3).png
The downside is that if you usually attach more than one doc to a card, it will be necessary to create more custom fields for each attachment. 
Hope that helps! :)
Katerina Bohacova
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 27, 2023

That would be the only think we would use Premium for and that is not really worth it. Thanks though.

Luciana Munhoz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 28, 2023

Hi Katerina!  I agree that would be great! I wanted to let you know that I checked internally and I see that we have this as a feature request in our backlog, so I have added your feedback as an official “+1” to that request! Hope this helps! If you have any additional insights into your workflow and how this feature would make Automation even more awesome, please don’t hesitate to share. Thanks!

Felipe Martínez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 24, 2023

Hi, I want to support that request. We have some rules for copying-linking cards, and we would like to automatically (upon a new trigger) remove the attached cards later (not possible currently). Greetings!

Luciana Munhoz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 24, 2023

Hey Felipe! Thank you! Just added your feedback as a +1 as well. ;)

Chris Munoz June 24, 2024

How would you implement the removal of a second (and possibly beyond) attachment using this method?

Luciana Munhoz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 25, 2024

Hi Chris!

I understand that you want to remove a second attachment and so on, right? You can use the suggestion in this thread. However, you will need to create a custom field for each attachment. It's this suggestion here.

Chris Munoz June 25, 2024

I've tried to follow that suggestion, but I am not able to properly format it so it actually removes the additional attachment. Is there wording that has to be added for it to be removed? The custom field doesn't allow for duplicates to be added, and I assume just adding a number or something after isn't sufficient enough for it to process correctly. 

Luciana Munhoz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 25, 2024

Hey Chris! Got it! I was testing here and to add more attachments you can change the automation a little bit.

First, you'll need to create a custom field for each attachment you want to add. So, in case your card has 3 attachments, you'll create 3 Custom fields (like Attachment 1, Attachment 2, etc).

Then, create an automation rule for each one using some filters to avoid one link overriding the other.

Here's my example:
AttachmentRules.png

 

Then to remove the attachment, you'll need to create a rule for each attachment that would be deleted using some labels as trigger. Here, I created 3 labels to correspond to each attachment. 

Example:

AttachmentRule1.png

 

Hope that helps!

Chris Munoz September 19, 2024

It def helped, but I am coming across a single issue following this format. It seems to work half the time, while failing the rest. From what I can gather, it seems to fail when there are two different document types sent as an attachment (excel and PDF to be exact). It seems that If the excel is set to the attachment 1 slot, then both documents are removed. However, if the PDF is set at the attachment 1 slot, the process does not remove the excel as the second attachment. Is there any reason for this? Can the custom fields be used to removed specific document types so this issue does not occur again?

Chris Munoz September 24, 2024

Actually I was able to get around this, but I had one issue remaining. It seems when I have two documents of the same type and are trying to separate them into different custom fields with the example shown above, it will put one in a custom field then replace it immediately with the second one. For example I have two custom fields Excel 1 and Excel 2. Using the process mentioned above, Excel 1 & Excel 2 will be filled with the first attachment at the same time, but then gets replaced with the second attachment in both fields. When it comes to the label to remove them, only one gets truly removed while the other remains as an attachment as it is unable to remove it due to the link not matching. (All attachments are public items with nothing in the body)

Test.PNGTest 2.PNGExample.PNG

Carolina Lopez
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 24, 2024

Hi Chris,

The behavior for all file extensions should be the same. Can you kindly check the automation log for any error messages?
Also, it would be really helpful if you could send us a screenshot of your rules. This will allow us to review them more easily.

Chris Munoz September 25, 2024

Hi Carolina, 

I had only went this method as it was actually effective in removing more than one document type. It seems when I use the example above, any document of the same type just gets replaced by the other. Screenshot is below, but as you can see, the XLSC file titled Sales by Flavor gets triggered then replaced by the other. When triggering the removal automation, only the one remaining in the custom field box gets removed. 

Activity report.PNG

Example 1.PNGExample 2.PNG

Carolina Lopez
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 26, 2024

Hi Chris,

Thank you for sharing the logs and troubleshooting details. I'm really interested in learning more about how you set up your rules. Could you please confirm if they're exactly the same as Luciana's? If you made any adjustments, I'd like to see them to gain a better understanding of how everything is functioning.

Chris Munoz October 1, 2024

Hi Carolina, 

 

Yes, the examples above only had the 6 rules set up and followed exactly how she had it placed. I did change them up after the fact as I needed a fix now than later, though I still have the same issue as mentioned before. It just seems to to be an issue when the attachment are an excel/same document. It replaces the document instead of placing an attachment in one custom field, reading it as filled and placing it in the second or third. The process has no issues if each document is different. It will place a PDF in one, notice it is filled, place the excel in the second and jpeg/other document in the 3rd slot. I', trying to figure this out but I am not having any luck. Example of the rules below, they are disabled now but were enabled when testing.

Rule Examples.PNG

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events