How to copy the attachment from one project to another using automation for jira

Abhishree Nagesh
Contributor
February 19, 2019

Hi,

Add on used is Automation for Jira 

If any attachment is added in the jira sofware project (ABC) the same attachment must be automatically copied to jira service desk project(XYZ)

However the issues would be linked because the rule is created to automatically creation of issue from jira service desk project   to jira software.

So please provide a rule to copy the attachment.

Regards,

Abhishree Nagesh

13 answers

7 votes
Julien Peyrade _ Elements
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 21, 2023

Hello,

I feel like there are two possible ways to understand this question : you may need to copy attachments when an issue is cloned, or you may need to synchronize attachments between two linked issues (when an attachment is added to one issue, it is automatically created in the other).

These scenarios can occur for files simply attached to an issue, or for attachments added to comments.

Currently, all these scenarios cannot be done natively with Automation.

However, our app Elements Copy & Sync can help you do all this.

It integrates with Automation, and lets you clone issues, including their attachments (directly in the issue or in its comments). It can also synchronize the creation of attachments between linked issues. It's a simple option to enable.

The app is free for 30 days, (and stays free if your instance is under 10 users), so feel free to give it a try, and don't hesitate to tell reach our Support if you have any question.

Kind regards,

Julien

Luanna Gobbato
Contributor
March 22, 2023

Actually, now attachments can be copied by Automation for Jira in the moment of creating another issue. I didn't test with the edit operation. 

Like John Funk likes this
7 votes
Peter Reiser
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.
November 23, 2020

I am using a workaround to link the attachments from the original ticket to the cloned ticket

 

Example Automation Code 

{{issue.description.replaceAll("!","_")}}

*Attachments links from Servicedesk Ticket*

{{#issue.attachment}}

- [ {{filename}} | {{content}} ] - {{size}} Bytes - {{author.displayName}} - {{created.jiraDate}}

{{/issue.attachment}}

Scott Price
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!
December 3, 2020

This is an excellent workaround. Thanks for sharing.

Marco Brundel
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.
December 4, 2020

Hello @Peter Reiser ,

I don't quite understand this solution yet. Can you provide more detailed information on how you have set this up? Possibly with screen prints.

Greetings, Marco

Peter Reiser
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.
December 4, 2020

@Marco Brundel 

In our use case when a service agent select "2nd Level" Support then we clone the ticket in the 2nd Level Servicedesk and link the attachment from the 1st Level Servicedesk ticket to the 2nd Level Servicedesk ticket using an automation rule 

 

 

 

Screenshot 2020-12-04 at 11.08.03.png

Like # people like this
Vinoth Vanchinathan February 18, 2021
@Peter Reiser 

Getting below error while trying your method to copy attachments from a software project to another software project. I have access to create attachments on both the projects.

Thoughts ?

Error message in audit log:
Action details:

Clone issue

Unknown fields set during clone, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored -Description (description)Issues cloned successfully

Peter Reiser
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.
February 18, 2021

@Vinoth

It looks like you have the custom field  -Description not configured in the target project 

Check your field settings for that project 

Sebastian Östlund April 21, 2021

Hi,

@Peter Reiser I tried your workaround (thanks for that btw) and it worked, kind of, but the images are not shown in the new request, instead you see the filename or the URL. 

At the bottom of the description field you see a list of all attachments and you can download them, But is it possible for them to show up directly, as they do in the original request? 

/Sebastian

pic1

image.png

pic2image.png

Like ayesha likes this
Peter Reiser
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.
April 22, 2021

@Sebastian Östlund  the script only links the attachments in the cloned ticket but does not render it inline. I have not found a way to extract the original image URL per image and then show it inline.

Maybe some other automation cracks know how to do it 

But is it possible for them to show up directly, as they do in the original request? 



Like # people like this
Jeroen Habets August 31, 2021

Thanks, slightly improved version:
- keeps other ! intact
- extracts filename as $1

{{issue.description.replaceAll("!([a-z]+[^.]+[.][a-z]+)[^!]+!", "$1")}}

*Attachments of original ticket*
{{#issue.attachment}}
- [ {{filename}} | {{content}} ] - {{size}} Bytes - {{author.displayName}}
{{/issue.attachment}}

Like Peter Reiser likes this
ayesha
Contributor
October 13, 2021

This is awesome workaround! Thanks!

Aida Selimova
Contributor
October 15, 2021

amazing solution! Thank you a lot @Peter Reiser 

Ronen Ghoshal
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!
December 22, 2021

Brilliant - thank you

7 votes
Deleted user November 12, 2019

Hello,

Is delivery date know for "Allow Copy attachments in Cloud" (https://codebarrel.atlassian.net/browse/AUT-1030)?

 

Regards

Lukasz Gawlik

5 votes
Marco Escobar
Contributor
April 3, 2020

Really need this for cloud.. We are having to manually copy attachments from one issue to another issue in another project.. I'd think that paying for the Jira automation service shouldn't have these limitations..  When can we expect a fix

Megan Densley June 2, 2021

Yes, we need this for cloud as well.  

1 vote
Simon H
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.
May 31, 2020

A workaround we have used is to clone the issue using Deep Clone. Deep Clone can copy attachments to the new issue.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 12, 2020

@Simon H  - But can you do a Deep Clone using Automation? Or is it only manual?

Mathew Sommers
Contributor
October 12, 2020

The interesting part is that Deep Clone has been able to carry over attachments for over a year during a clone, yet Code Barrel and now the acquired group still says it cannot be done.  Hoping it can get sorted out as this is one of the last few things I have not been able to fully automate within Jira.

 

-Matt

Like # people like this
Simon H
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.
October 15, 2020

@John Funk Deep Clone can be called as a post function (documentation), which is a form of automation.

It would/will be wonderful when Atlassian open up AfJ for third parties to register triggers and actions in their automation engine. 

Like # people like this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 16, 2020

Ah, forgot that it is available in a post function - thanks for the reminder @Simon H !!

Mathew Sommers
Contributor
October 16, 2020

ooohhhh ... AfJ trigger for deep clone would be awesome!

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 16, 2020

Make it so, @Simon H !!!   :-)

Make it so.jpg

Like Simon H likes this
Marlene Kegel - codefortynine
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 18, 2020

Hi,

I am the product manager of Deep Clone for Jira.

If anyone has questions or feedback about Deep Clone post-functions or integrating Deep Clone with Jira Automation, don't hesitate to get in touch with us :)

Best,

Marlene

Like John Funk likes this
1 vote
israellias
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!
March 30, 2020

Since Automation for Jira was acquired by Atlassian, will be copy attachment posible on automation rule?

1 vote
Luanna Gobbato
Contributor
February 18, 2020

Looking foward for this new feature!

1 vote
Mathew Sommers
Contributor
October 2, 2019

Same problem, as well with links and comments.

 

These are all doable in Jira, DeepClone does this now, should be a way to figure this out.

 

We really need it as well.

1 vote
Deleted user February 20, 2019

Hi Abhishree,

I'm afraid that it is not currently possible to copy attachments in Cloud, we have an improvement open around this, https://codebarrel.atlassian.net/browse/AUT-1030 however it is blocked on the fact that there is no Jira API to allow us to do this. It is something that we've raised with Atlassian.

Cheers,
Simeon [Automation for Jira]

Abhishree Nagesh
Contributor
March 1, 2019

Hi,

Is it possible through any add on like script runner for jira .

As it is blocker in my organization ,so is there any work around.

 

Regards,

Abhishree Nagesh

Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 3, 2019

Hi @Abhishree Nagesh

instead of linking the issues, you could also use an issue synchronization app. You could configure it so that it creates the Jira software issue when you want it and copy over all the interesting information to your Jira software.

Being part of the product team of Backbone Issue Sync, I can tell you that we also are able to copy attachments. I believe the other issue sync apps can also do this - maybe someone else has a comment on this?

Cheers,
Matthias.

Alexey Saltykov
Contributor
May 18, 2020

Thank you! I will try

0 votes
Jaroslaw Wojciechowski
Contributor
January 22, 2021

Hey Guys, 

based on @Peter Reiser answer , if you using automation to create new jira from exisitng one ( not clone it or copy it) then you can use this in the description json

 

{
"update":{
"description":[
{
"set":" \n\nAttachments: \n {{attachment.content}} \n\n {{#issue.attachment}} \n [ {{filename}} | {{content}} ] - {{size}} Bytes - {{author.displayName}} - {{created.jiraDate}} \n {{/issue.attachment}}"
}
]
}
}

just format if first in some online json formatter.

 

This gives you 2 ways of attaching URL of the attachement into the ticket description - use the one you like the most.Screen Shot 2021-01-22 at 9.42.33 AM.png

Hope this helps

Jarek

Celeste D'Alessandro
Contributor
April 29, 2021

Thaks!

0 votes
Luanna Gobbato
Contributor
November 25, 2020

Hey guys,
This is the new bug link: https://jira.atlassian.com/browse/JRACLOUD-74937 please, vote. 

0 votes
Webdigit
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!
September 6, 2019

Same Problem :) Would be helpfull ;)

0 votes
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 19, 2019

Hi @Abhishree Nagesh,

are you using the clone action for creating the initial issue links? According to this feature request, this seems to be working on server, but not for Cloud. Are you using the latest version?

I'm not an Automation expert, but probably @Nick Menere can help. :)

Cheers,
Matthias.

Abhishree Nagesh
Contributor
February 19, 2019

@Matthias Gaiser _K15t_ 

Thanks for your reply .

Application is running on cloud.

Help me out by providing the JSON rule to copy the attachment.

Please find the below attachment .

this is how i created a rule.

 

copy attachment.PNGRegards,

Abhishree Nagesh

Like # people like this
Christian Zelada
Contributor
August 1, 2019

I have the same problem ... really need it!.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events