Is there a way to base a Jira Automation condition off of a user's role?

Steven Johnson
Contributor
December 4, 2023

We have a permission scheme for an action that allows both Admins and Developers permission, but there are certain cases where I would like to only allow an Administrator to be able to perform an action. I was thinking that I could create an Automation rule that would check an initiator's user role, but I cannot seem to find if that is even possible or not. Is there a smart value that can be used to return the user role value? Thanks!

1 answer

1 accepted

3 votes
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2023

There isn't a smart value for the user that would get you the project role they belong to, so you have two options. You could either create 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.

Steven Johnson
Contributor
December 4, 2023

Thanks Mikael! I do not think the manual rule would work for what I'm trying to do because I want a trigger on transition. But the webhook might be exactly what I could use. I only started to learn about those last week, so I'm still completely ignorant on how to use them well. Could you send me a sample webhook for how to get that project role from the initiator of a rule?

Bill Sheboy
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.
December 4, 2023

Hi @Steven Johnson 

Adding to Mikael's answer:

Here is a how-to article for calling a REST API function from a rule: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

If you perform a web search for your Jira Server REST API you can find the function needed for the call.

Kind regards,
Bill

Like Mikael Sandberg likes this
Steven Johnson
Contributor
December 4, 2023

Thanks to you both! This should get me what I need. I appreciate the information and help!

Like # people like this

Suggest an answer

Log in or Sign up to answer