Forums

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

Copying Comments with Attachments Between Jira Projects

Mikołaj Ogrzywalski
Contributor
January 29, 2024

Hi Atlassian Community,

I hope this message finds you well. I'm currently working on a project where I need to copy comments, including any attached files, from one Jira project to another. I've come across the challenge of ensuring that all relevant information is transferred seamlessly.

 

jira11.JPG

However, I'm still refining this solution, especially when it comes to dealing with attachments. If anyone has experience or insights into efficiently copying comments, including attachments, between Jira projects, I'd greatly appreciate your guidance.

Thank you in advance for your help!

Best regards,

2 answers

0 votes
Luiz Ricardo Pereira da Silva
Contributor
January 29, 2024

Hello @Mikołaj Ogrzywalski
I needed to create a solution like this and based on performance and ease of maintenance. Follow the following steps:

image.png
For the Trigger, I used the Issue commented option in the tests;
image.png
Through a "Branch rule / related issues" with the following parameters:

image.png
You can choose a specific linked type if necessary to improve the execution filter.

To help with maintenance and performance, I created 3 Variables to store the value that will be used in the comment action:

image.png
{{author}} = {{triggerIssue.comments.last.author.displayName}}
{{comment}} = {{triggerIssue.comments.last.body}}
{{attachment}} = {{attachment.last.filename}}

This last variable I only added to use the name of the last file attached to the issue just for control.
In your scenario it may not be necessary.

I created an Edit Issue Action to copy the Attachments from the triggered Issue:

image.png
This action will always copy all Attachments but, incrementally, don't worry about duplicate attachments as it won't happen.

Lastly, I created the Comment Issue action:

image.png
Note that with variables the values are smaller, in the case of a rule that contains the same information in several Actions, simply change the value of the variable and you do not need to change it several times, making maintenance easier.
Another positive point is the inclusion of additional text such as:

*{{author}}* said:
{{comment}}

You can highlight the Author's name among others through Markdowns:
https://support.atlassian.com/jira-software-cloud/docs/markdown-and-keyboard-shortcuts/

Hope this helps.

0 votes
Mirek
Community Champion
January 29, 2024

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events