I am helping a colleague who wants to copy comments from child issues up to parent issues whenever comments are added to child issues.
I created an automation that triggers on Work Item Commented, then simply branches on the Parent and in the brnach uses the action "Comment on work item" with {{triggerIssue.comment.body}}, with the option "Prevent duplicates by only adding this comment once to a particular work item." selected.
This works, the first time a comment is added to a child. However, any subsequent comments added, do not get added to the parent but the automation succeeds but says "This comment has already been added to the work item:". Even though this is a different comment. What am I missing
Hi @Rees_ Ian ,
You’re not missing anything — this is how Jira Automation works.
The “Prevent duplicates” option does not reliably distinguish between different comments when using {{triggerIssue.comment.body}}. As a result, Jira thinks the comment was already added and skips subsequent ones.
To fix this, you have two options:
Option 1 (Recommended – simple):
Remove the checkbox “Prevent duplicates by only adding this comment once”.
Each new child comment will then be copied correctly to the parent.
Option 2 (If you must prevent loops):
Append a unique value to the comment, for example:
{{triggerIssue.comment.body}}
—
Copied from {{triggerIssue.key}} at {{now}}
This makes each comment unique, so Jira won’t treat it as a duplicate.
Thanks.
Actually if I disable the "prevent duplicates" and use {{triggerIssue.comment.body}}, then what happens is when the automation runs then the comment added to the parent is a concatenation of ALL comments ever added to the child. However, that is fixed by using {{comment.body}} instead of {{triggerIssue.comment.body}}.
Similarly I had tried making things unique by adding something like {{now}} and {{comment.created}} but it makes no difference - if you have "prevent duplicates checked" - it will only ever add the first comment.
So the solution appears to be to use {{comment.body}} instead of {{triggerIssue.comment.body}} and uncheck "prevent duplicates"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that’s exactly right
The correct approach here is to use {{comment.body}} (not {{triggerIssue.comment.body}}) and disable “Prevent duplicates”.
{{triggerIssue.comment.body}} resolves to the full comment history context, which is why you were seeing concatenated comments. Using {{comment.body}} ensures only the newly added comment is copied to the parent, and disabling duplicate prevention avoids Jira incorrectly blocking subsequent comments.
Good catch — this is a subtle but important automation detail.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rees_ Ian
The smart value you are accessing is a list of comments, and the single comment from the trigger may not work consistently due to value confusion inside of the branch. Thus, each subsequent rule execution to the parent will potentially collide with earlier comments.
Please use this value to add the new comment to the parent, copying it from the trigger:
{{triggerIssue.comments.last.body}}
And, even though the rule cannot add the comment on behalf of the original author and at that specific date / time, those attributes could be added as text in the new comment.
Kind regards,
Bill
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.