Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Check whether last comment author is not in a group

Tom De Blende
Contributor
April 19, 2023

Dear,

I want to execute an action in Jira Automation when a ticket is closed and the last comment is made by a user that is not part of an Atlassian group. I did some digging, and I'll probably need a condition based on {{comment.comment.last.author}}. However, I'm not quite sure how to verify its membership of a group. How can this be done?

If this would not be possible, how could I check whether the last comment was made by a customer user?

Thanks!
Tom

2 answers

1 accepted

0 votes
Answer accepted
Tessa Tuteleers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 19, 2023

Hi @Tom De Blende , 

you could do this with a condition. 

If the trigger is "Issue commented", you can use the user condition to check if the user who triggered the event is not in the default application user group.

->  This works on the assumption that any user who does not have a license is a customer. 

Hope this helps! 

- Tessa

Tom De Blende
Contributor
April 20, 2023

Thanks Tessa. How does one check group membership in Jira Automation?

Tessa Tuteleers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 20, 2023

Hi @Tom De Blende , 

it's a specific kind of condition called "User condition", you can find it here: 

Screenshot 2023-04-20 at 13.16.16.png

Screenshot 2023-04-20 at 13.16.28.png

Hope this helps!

- Tessa

Tom De Blende
Contributor
April 21, 2023

It  does and it doesn't :) Because I can't enter {{comment.comment.last.author}} in the User selection dropdown. One can only use a selection of criteria.

Is there to verify this?

Tom De Blende
Contributor
April 21, 2023

Ideally something like this, but where the condition can be group membership:

 

Clipboard01.jpg

Tessa Tuteleers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2023

@Tom De Blende , 

this would be ideal, but sadly it does not work because indeed there is way to compare this to group memberships. 

That is why I propose to set the trigger as "Issue commented", then use not the "Advanced compare" but the "User condition", use "User who triggered the event" and then you can compare group membership. 

This will only work if you use "Issue commented" as trigger, but working with the limitations of Automation for Jira, it's the only way I know how to solve this. 

- Tessa

Tom De Blende
Contributor
April 21, 2023

Yes, I understand. Unfortunately, this is not fit for the use case. I want to be notified when a ticket is (automatically) closed and the last comment was made by a customer. The trigger Issue Commented is not useful.

Thanks for thinking along!

Tessa Tuteleers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2023

Ah, that's too bad. 

Maybe there are other options that I'm not aware of (the suggestion given by @David Pezet  for example) but, 
If this is really a "Must have" requirement, you could think about setting up a seperate rule as I described with the trigger "Issue commented", but instead of doing the action you need right then, use the rule to set a flag on your issue (i.e. use a custom field e.g. "Last commented by customer") that you check or uncheck with every comment based on if it was a customer or not. 
Then you can use your rule (trigger = transitioned to closed), and check whether or not the field is checked at that point in time. 

Not the cleanest way to do it, but it would work. 

- Tessa

Like Tom De Blende likes this
Tom De Blende
Contributor
April 21, 2023

This is how I ended up doing it, and it works as expected. Thanks for all the help ;)

1 vote
David Pezet
Contributor
April 19, 2023

You might try using a Web Request (additional article) to Get users from group and then compare if webResponse.body contains the last comment author. If you need to iterate through all the comments to find the last user comment (and not just the last comment) that would take a bit more wrangling. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events