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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

12 answers

Hello,

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

 

Regards

Lukasz Gawlik

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}}

This is an excellent workaround. Thanks for sharing.

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

@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
@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

@Vinoth

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

Check your field settings for that project 

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

@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 Sebastian Östlund likes this

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}}

This is awesome workaround! Thanks!

amazing solution! Thank you a lot @Peter Reiser 

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

Yes, we need this for cloud as well.  

1 vote
Simon Herd Atlassian Team 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 Oct 12, 2020

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

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 Herd Atlassian Team Oct 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 Oct 16, 2020

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

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

Like John Funk likes this
John Funk Community Leader Oct 16, 2020

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

Make it so.jpg

Like Simon Herd likes this

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

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

Looking foward for this new feature!

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]

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

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.

Thank you! I will try

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

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

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.

Same Problem :) Would be helpfull ;)

0 votes

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.

@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

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍂📹 Apptoberfest demo contest roundup: vote for your favorite demos!

Hi Community! The submissions are in (and listed below) for the 🍻🍂Apptoberfest🍂🍻 Demo Competition and it’s time for you to place your votes for the best: Analytics & reporting app demo ...

102 views 2 11
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you