Hi there,
I have a question regarding automation.
Is it possible to extract last comment author in JIRA Automation. I am using JIRA server.
I tried with - commentLastCreatedBy & {{issue.comments.last.author.displayName}}
But no luck
Thank you
Hi @Harsh ,
I've managed to trigger an automation rule that comments using the last comment author name using {{issue.comments.last.author.displayName}}
Additionally maybe you might find the article bellow useful.
https://confluence.atlassian.com/automation074/smart-values-1141481319.html
Thanks,
Mihai Schwarz
Hi @Mihai Schwarz
I used the same thing , but I want to compare if the last comment author is assignee, which is not working as expected
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Harsh make sure that you are getting the usernames as the format for the first argument is simply a text and the assignee is a username (most probably email format).
If you can share more information I can try an replicate your case to see if I can help you with a solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the information.
I actually modified the one which you sent to compare(advanced compare)it to the custom field user field which act as second reporter
i.e {{issue.comments.last.author}} = {{issue.customfield_123.displayName}}
And edited the issue as per the requirement via automation.
Hence your information helped me.
I'll accept the answer. :)
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
For Jira Server Automation, the correct way to reference the last comment's author depends slightly on your Automation version, but here are the most reliable methods:
In Jira Automation's smart values, the comments array is sorted with the newest comment first. Therefore, index `0` refers to the most recent (last) comment.
You can use this value to:
Use the "Send webhook" action with a dummy URL or the "Log action" action (if available in your version) to output `{{lastComment.author}}` or `{{issue.comments.0.author}}` and see the raw value in your audit log. This helps confirm you're getting the expected user object.
Give `{{lastComment.author.displayName}}` a try first. If that variable is empty, fall back to `{{issue.comments.0.author.displayName}}`.
Hope this helps!
Sarah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Harsh
I do not believe displayName values are required to be unique for users in a Jira site.
Instead you may want to compare the accountId values; those will be unique.
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.