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
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
Thanks Tessa. How does one check group membership in Jira Automation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tom De Blende ,
it's a specific kind of condition called "User condition", you can find it here:
Hope this helps!
- Tessa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ideally something like this, but where the condition can be group membership:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is how I ended up doing it, and it works as expected. Thanks for all the help ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.