You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Good afternoon all!
I have this question, an user is asking to create a rule to create a new issue based on data from trigger issue in a different project.
The problem I have is that information that he needs includes comments. He wants to copy all comments (or internal notes only if it's possible) to this new issue in project AA
How can I copy the comments? maybe including a json? how should it be?
thanks in advance,
Ro
The issue comments are a list smart value, and so you could iterate over them to add to the new issue. Please look here for information about the field: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--issue.comments--
Next, you asked about filtering to only copy the internal ones. That can be done by using smart value, list filtering. There is an example of filtering on internal comments in this article: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
Kind regards,
Bill
Thanks @Bill Sheboy
I have another question (sorry! but never worked with comments on automation)
can I copy the comments from the original to the new issue? Because I have try to copy to a custom field, and worked but do not know how to copy the original comments using smart values you suggested into the comment section in the new issue.
Is there any way? or should I use this custom field?
thanks in advance
Ro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Ro!
Although you could use a custom field to store the copy, you could also add them as comments, either as one giant comment to the new issue or one-by-one (with an advanced branch). If you take a look at those links I provided they show examples of how to iterate over the comments list for an issue. For example:
{{#issue.comments}}
Comment by: {{author.displayName}} at: {{created}}
{{body}}
{{/}}
Please note: if you copy them with an automation rule, there is currently no ability to sort a smart value list. That means when you add the comments they will appear in a random order relative to the comments' date/time added. If you want them in the order they were added, please investigate a marketplace addon, as @John Funk suggested.
Thanks,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still don't know where to put this and how.
I do not have "Comment" field available on "choose field to set". So, how can i associate:
{{#issue.comments}}
Comment by: {{author.displayName}} at: {{created}}
{{body}}
{{/}}
to the comment field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After the issue is created, you may branch to it and then use the Comment Issue action. For example:
{{#triggerIssue.comments}}
Comment by: {{author.displayName}} at: {{created}}
{{body}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Bill, but this won't work for my scenario.
My scenario is:
I have an issue in project A and want to copy or clone to Project B, and all comments from issue in project A should be copy to the new issue in project B.
So when the Branch section is executed, it is looking for most recently created in the current project A (In the rule restricted to projects cannot be edited)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If this rule is running as a global/multi-project scope, I believe that would still work.
If the most-recently-created branch does not work, a global/multi-project rule could still use JQL for your created issue key for the branch.
Please note, that there are execution limits per month for global/multi-project rules, so check with your site admin to confirm your limits before trying a global rule.
A more elaborate work-around which does not require a global/multi-project rule is to call the REST API from a web request in the rule to add the comments.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rosana,
We actually use the add-on called Deep Clone to do this.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.