Hi Team,
I am looking for an option to send the last comment by Assignee as a part of reminder email to reporter.
With {{issue.comments.last.body}} I can get the last comment but how can I get the last comment by assignee?
Thanks,
Hi @Tejas Patil
This is possible to do within an automation rule, and requires some advanced techniques...
One would think smart value, list filtering would work for this scenario:
!! THIS DOES NOT WORK !!
{{#issue.comments}}{{#if(equals(author.displayName,issue.assignee.displayName))}}{{body}}{{/}}{{/}}
The reason it does not work is the other issue fields are not visible once inside of the iterator over the comments. That is, the assignee cannot be used for the filtering.
A possible workaround is to expand the comments as delimited text into a variable; create another variable for a dynamic, regular expression; use the inline form of list iteration to find a match(); get the last comment in the list; and finally parse out the comment body.
These techniques may be used for many scenarios with such limitations, and an example rule could be:
({{issue.assignee.displayName}}:.*)
{{#issue.comments}}{{author.displayName}}:{{body}}~~{{/}}
{{varCommentList.split("~~").match(varRegularExpression).last.substringAfter(":")}}
I strongly encourage creating such a rule in a test project, and pausing to learn how it works before using it in you own projects.
Kind regards,
Bill
Hi @Bill Sheboy
Thank you very much for your detailed explanation, it took a while to process and amend it, but it is working as expected.
Regards,
Tejas
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.
Here is the final rule:
Currently posting it as comment and in future will route it via email if needed.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I think it is complicated (but not impossible) to retrieve this value via smart values with a list https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists with conditional logic https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/
Or a easier way, but it requires admin product access.
(Create a custom multi-line text field called "Last Comment Assignee").
Through automation, trigger an action when a comment is added, then compare:{{issue.comments.last.author.displayName}}
and {{issue.assignee.displayName}}
.
This way, you can use the smart value of this new custom field for other purposes.
:)
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 idea about custom field, I didnt give a try as it involves product admin.
Regards,
Tejas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.