How can I copy only attachments within a specific field to a new issue using automation?

Bianca Russell December 4, 2024

I have an automation that creates two new issues and populates the description with a field from the trigger issue. Problem is that when we add images and/or files within the field on the trigger issue, the images and attachments show as a placeholder box with 'failed to load' on the new issues and do not show properly. 

We don't want to copy all attachments from the trigger issue, only the ones we add to this field.

Anyone know what's stopping our images copying successfully?

1 answer

1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2024

Hello @Bianca Russell 

Since your question pertains to an Automation Rule, please provide screen images showing the entire Automation Rule.

There does not appear to be a native action for selectively copying attachments from one issue to another. You can use the Attachment field to initially copy all attachments.

Screenshot 2024-12-04 at 2.30.36 PM.png

You can use the Delete Attachment action to delete Attachments based on using regex to match the attachment name.

Screenshot 2024-12-04 at 2.31.33 PM.png

 

This is a bit beyond my experience. You might want to post your question in the forum specifically for Automation to see if that focused groups has better suggestions.

https://community.atlassian.com/t5/Automation-questions/qa-p/automation-questions

Bianca Russell December 4, 2024

Thanks for taking a look. Here's the automation.

Screenshot 2024-12-05 115549.pngScreenshot 2024-12-05 115639.pngScreenshot 2024-12-05 115740.png

Image 3 is the copy field setting. The Bug Description field is multiline custom field with pre-filled format and uses Wiki style render to bring through formatting. Works fine except no images or attachments copy correctly.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2024

Thank you for that additional information.

Copying the content of a field does not copy the Attachments referenced in the field. 

As shown in my image you can use the Attachments field to copy all the attachments from the source issue to the destination issue.

Unfortunately there is no pre-built Automation Rule solution for copying Attachments selectively (i.e. only those referenced in a specific field) within the Clone Issue or Create Issue actions.

Bianca Russell December 4, 2024

OK, thank you.

We don't want all attachments because the original contains junk attachments like email signature images and such from customer requests. 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2024

Currently I'm not seeing a method to accomplish what you want other than initially copying all attachments and then using the Delete Attachments action to remove the ones you don't want.

There does not appear to be an API endpoint that you can call to copy specific attachments from one issue to another.

There might be a way to use the API to get specific attachments from one issue and then add them to another, but the API to add an attachment to an issue appears to be based on uploading an attachment from location.

 

I do recommend again that you consider reposting your question in the Atlassian Automation forum where the group watching the forum may have more expertise in such use cases.

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