Forums

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

Copy latest comments and attachments in Jira automation

Ragvi Ttpt
Contributor
October 2, 2020

Hi,

Every time a Jira Service Desk ticket is created I clone it based on some criteria. Every time a comment is added to the original ticket, I copy the comments over to the cloned ticket. I am using the Jira Automation plugin to achieve these actions. Sometimes I have attachments as part of the comment.  

I am using the following JQL to copy my comments over, but this is copying just the textual portion of it and not the attachment. 

{{triggerIssue.comment.last.body}}

There is a way to copy Attachments from the Trigger issue (parent issue) in Jira Automation by using its Edit Issue functionality. The problem with this is that it copies All the attachments and not just the latest one that triggers the automation, hence I am ending up with multiple copies of the attachments.

image.png

Is there a way to copy latest comments along with its attachment if any. 

 

3 answers

3 votes
Pablo Serra
Contributor
September 24, 2021

Hi @Ragvi Ttpt ,
I came across this question looking for away to avoid duplicating attachments as well. I don't know if the action Delete Attachment wasn't available back on October 2020, but I worked around it by deleting the attachments on the target issue and then copying them back from the trigger issue. Maybe this, combined with some smartvalue, may be of help for you.

Ragvi Ttpt
Contributor
September 24, 2021

I can't believe I did not think about this!!. It sounds like that might work. Let me check that out. Thanks much.

Juan Anzaldo
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 24, 2021

Hi!, I have the same problem copyng attachments from a comment issue to a comment subtask,

Did it work? if so, how did you do it?

 

thanks!

Ragvi Ttpt
Contributor
November 25, 2021

You could try what Pablo suggested above. Delete all the attachments in the destination and copy over each time.  Hope that helps. 

jcrosby
December 10, 2021

@Ragvi Ttpt In your screenshot, what field do you have selected in the "Choose fields to set" drop down, that allows you this option to "Copy attachments from Trigger issue"

1 vote
Ivan Lima
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 Champions.
October 3, 2020

Hey @Ragvi Ttpt, to my knowledge, you can't selectively copy attachments over. You can find the improvement AUT-1196, in their backlog, related to this item. Also, when copying the attachments from the triggered issue, you might have come across duplicate attachments, which also has been tracked as another improvement, AUT-1210

I haven't explored alternative ways to achieve this using Automation for Jira. Therefore, I'm not sure whether or not there is a workaround here. I do know you can access those fields through smart values such as {{issue.issuelinks.first.outwardIssue.comment.last}}, but they bring the description/text and not the actual objects.

Cheers,
IL.

0 votes
Michalis Motis
May 10, 2026

Dear Team,

We are experiencing the same issue on our side as well.

The workaround we came up with is the following:

  • Copy all attachments and add a comment on the ticket using the latest attachment ID:
    {{issue.attachment.id.max}}

  • Loop through all attachments, and if the attachment ID matches {{issue.attachment.id.max}}, add the comment:
    {{issue.attachment.name}}

Once you have the filename, on the next ticket you can loop through the attachments again and delete any unnecessary files using the DELETE request. This way, you only keep the files you actually need.

 

This solution took a bit of time as we mixing 2 automation to get this work done as we missing functionality from atlassian by copying last attachment.

Hope this helps 😊

Screenshot from 2026-05-11 08-42-19.png

Best regards,Screenshot from 2026-05-11 08-40-05.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events