Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How To Determine if Reporter is the Only User That has Commented

Jeff Gordon
Contributor
January 13, 2023

I need to implement an Automation for Jira rule that will send an email when nobody except the Reporter has commented on an issue some number of days after it was created.  This is Jira Data Center 8.13.18.

I thought I could use advanced compare with two smart values to see if they are equal.

{{#issue.comments}}{{author.name}}{{/}} - generate a string of all comment authors so if there are three comments it might look like 'jgordonjgordontwilson'

{{#issue.comments}}{{issue.reporter.name}}{{/}} - generate string with equivalent number of repeating reporter name that I want to look like 'jgordonjgordonjgordon'

The first value populates (I have logged its output)

The second value does not populate, it's blank.  I am assuming this is because when I am in the context of looping through comments, {{issue.reporter.name}} is not available.

Any ideas on this or possibly another approach to determine if the Reporter is the only one who has commented on the issue?

1 answer

1 accepted

1 vote
Answer accepted
Darryl Lee
Community Champion
January 15, 2023

Hi @Jeff Gordon --

I found a janky, if workable solution:

Quicker way to get your list of authors:

{{issue.comments.author.name.join(" ")}}

And then I add replaceAll to generate the reporter list to compare it to:

{{issue.comments.author.name.join(" ").replaceAll("(\b\w+\b)",reporter.name)}}

I'm not sure why the replaceAll doesn't include the spaces when it replaces "All", but it seems to work, so there you go.

Jeff Gordon
Contributor
January 17, 2023

Brilliant!  Thanks so much!

Suggest an answer

Log in or Sign up to answer