Automation: Is user part in group that has role

Sven
Contributor
August 28, 2023

Hello community,

I would like to adjust the security level through automation.

This should happen based on the project role -> If the role of the author is "external," the ticket should be "external" level. In all other cases, the level should be "internal."

Problem:
The users are not identified by name but rather through groups within the project.
So, the automation would need to check:
Is the user part of a group that has the "external" role in the project?
However, I'm struggling with this.

Is this possible? If yes, how?

1 answer

1 vote
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 28, 2023

Hi @Sven Schmitting 

In automation you could tigger based upon create issue for example.

And based upon a user condition set the security level.

example:

Screenshot 2023-08-28 at 16.59.49.png

Joep.Beusenberg November 12, 2024

Hi Marc,

This doesn't seem to work as advertised.

If a user is in a group that has a role, but the user is not directly part of that role, the checks fail.

So if John is Agent, then "User is in role Agent" is true.
But if Jons is member of for example the "Support" group, and the Support group is set to be Agent, then "User is in role Agent" is still false for John.

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 12, 2024

Hi @Joep.Beusenberg 

That is a valid action, as the "User is on role Agent" applies to a "user" granted the role agent, not a "group" granted to a role

Then you should use "User is in Group" and then specify the "Support group"

 

Joep.Beusenberg November 12, 2024

Hi Marc,

But that's not the check I want to perform. I want to check if the user acting is an Agent. Regardless if they get that role directly, via a group, or via any other way.

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 12, 2024

HI @Joep.Beusenberg 

That can't be done as their is now actionable option for a group in this way

The answer I gave initially was based on a group related question, not related to groups is in a role

This could however done by creating a manual automation and only allow a specific group to run it or the other option would be in the automation use the web hook component to get the project role and then check if the user is in the role you want them to be in before the automation proceeds.

Here is a how-to article for calling a REST API function from a rule.

Joep.Beusenberg November 12, 2024

Thanks,

Seems an overly complex way to do something mundane, though.

What I'm trying to achieve is to have an automation, where if an Agent writes a comment, change the status the "Waiting for User", and if the author is not an Agent, change the status to "Waiting for Agent".

To do that, I should be able to somehow check if the author has the "Service Desk Agents" role. Automations don't seem the right place to then check for "OR User in role OR User in group which has role". That would be a nightmare to maintain.

Am I just overlooking an obvious solution to what I want to achieve here?

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 12, 2024

Hi @Joep.Beusenberg 

Then this should be simple.

You have user groups assigned to roles, if I'm understanding correctly from your previous comments.

If this is correct.

Use the example I posted and based on user condition, "user who triggered the event" and select is user "is a customer" or user "is not customer"

Or use the user condition "user is in a group" and "user is not in a group"option,

for both use an If/ELSE condition.

Then action the required transition.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events