Can i copy comments in activity of an issue.

Tushar Shinde May 24, 2023

Hi Team,

I wish to copy 'comments' mentioned in activity section of an issue to new issue which gets created via automation on placing parent issue in a particular column. I am able to copy other field of parent issue but cannot find option to copy comments.

Please help me achieve it.

5 answers

1 vote
Jan-Hendrik Spieth
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 24, 2023

You can iterate over comments, via smart value: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--issue.comments--

And so you would iterate the comments and copy each one to the new issue.

I hope this gets you going :-)

Tushar Shinde May 26, 2023

HI Jan,

 I tried both of the below codes in 'Additional Fields' :

{{#issue.comments}} Comment by: {{author.displayName}} at: {{created}} {{body}} {{/}}

as well as 

"comment": [ { "add": { "body": "{{#issue.comments}}
Comment by: {{author.displayName}} at: {{created}}
{{body}}
{{/}}
} } ]

as suggested by @Sachin Dhamale 

Both codes return error "Error while parsing additional fields. Not valid JSON." when published and triggered.

What could i be doing wrong here ? Please suggest.a

Jan-Hendrik Spieth
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 28, 2023

The snippet looks ok to me. It should work when you are using this in a branch, with action "comment on issue". 

Can you give us a bit more context? How does your rule look like?

0 votes
Luka Hummel - codefortynine
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 26, 2023

Hi @Tushar Shinde

If you are having trouble cloning issues via Jira automation and don't mind using a third-party app you can try our Deep Clone for Jira app.

If you still want to use Jira Automation to trigger a clone you also can do that with a looping transition and a Deep Clone post function as described here.

0 votes
Thibaut Subra _Elements_
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 25, 2023

Hello @Tushar Shinde 

If you don't mind using a third party app, I can recommend our Copy & Sync application that can help you with that. Our app allows you to copy and synchronize issues.

In your case, you can easily copy and synchronize comments so you keep consistency between your issues. You can also trigger your recipe directly with Automation if you want to integrate specific actions in your flow.

Anyway, I will be glad to help if you have any questions! Don't hesitate to take a look, our app is free under 10 users or there is a 30-Day trial.

Regards

0 votes
Sachin Dhamale
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 25, 2023

Hi @Tushar Shinde 

Its little bit tricky

You need to use add comment action  and add the smart value in that as mentioned by  @Jan-Hendrik Spieth

Also try this

you can try this in automation rule use JSON value in additional field section

"comment": [ { "add": { "body": "<Here you can use the smart value mentioned by @Jan-Hendrik Spieth " } } ]

Tushar Shinde May 26, 2023

HI Sachin, 

I tried both of the below codes in 'Additional Fields' :

{{#issue.comments}} Comment by: {{author.displayName}} at: {{created}} {{body}} {{/}}

as well as 

"comment": [ { "add": { "body": "{{#issue.comments}}
Comment by: {{author.displayName}} at: {{created}}
{{body}}
{{/}}
} } ]

as suggested by you. Both codes return error "Error while parsing additional fields. Not valid JSON." when published and triggered.

What could i be doing wrong here ? Please suggest. Thanks.

0 votes
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.
May 24, 2023

Hi Tushar,

I am having trouble following everything that you are doing, but you should be able to use the smart value of {{issue.comments}} to get those comments. Or {{triggerIssue.comments}} dependending on how you are getting there. 

Tushar Shinde May 27, 2023

Hello John,

I am trying to copy content from an issue in Project A to new issue that gets created in Project B via automation. Automation rule triggers when an issue is moved in a particular column. I am getting description, assignee, attachment and other details from parent issue. It's only the comments that i am unable to copy currently.

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.
May 28, 2023

Did you try {{triggerIssue.comments}}

Tushar Shinde May 28, 2023

Yes, I tried it now. Getting "Error while parsing additional fields. Not valid JSON." error when automation triggers.

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.
May 29, 2023

Probably just better off using one of the add-ons like Deep Clone. 

Suggest an answer

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

Atlassian Community Events