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.
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 :-)
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 " } } ]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try {{triggerIssue.comments}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I tried it now. Getting "Error while parsing additional fields. Not valid JSON." error when automation triggers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Probably just better off using one of the add-ons like Deep Clone.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.