How to restrict workflow transition to "Automation for Jira"?

Mashu Duek February 12, 2021

Info: Free tier, Next-gen software project

ISSUE:

When creating a git branch I am moving a card from "SELECTED FOR DEV" to "IN PROGRESS" through an automation trigger. I would like to be able to limit that transition so that the only one who can move it is the actor of that trigger (the Jira bot). Jira defaults the actor of the trigger to be "Automation for Jira". 

ATTEMPTED: 

I've visited Project Settings -> Access to see if I could find the user Automation for Jira, in hopes of being able to apply the restriction to Admin users only, but Automation for Jira is not there.

Screenshots:

Transition restriction popup window:

Screen Shot 2021-02-12 at 3.59.39 PM.png

Automation Rule displaying the Actor (unchanged from default):Screen Shot 2021-02-12 at 4.04.47 PM.png

4 answers

2 votes
Hugo Gómez June 6, 2022

Hi! - I needed to do this as well, and figured out a workaround that may work on some situations. I can think of some scenarios where this may not solve your case.

In the workflow, the exclusive transition has a rule that allows the issue to transition only if it contains a certain label. In my case the label is "JiraAutomation".

Then, in automation, before using said transition, add the label to the issue, perform the transition, and then you can remove the label afterwards.

It is like marking the issue to enable the transition.

This works as a charm, because users won't see the transition in the list of available transitions, unless they manually add the enabling label. Just don't spread the word to the team.. haha!

Hope this helps someone!

Hugo Gómez June 7, 2022

Update with new discoveries...

1. After assigning the label to the issue to transition, you must re-fetch the issue's data (there is an action for that)  before performing the transition, this will ensure the label is properly applied before attempting the move.

jira-automation01.png

2. The experience on the Android mobile app (v93.1.1)  is not as good as on the browser app. In the browser the transition is highlighted as not available to user. (see drop zone on right)

jira-automation02.pngIn the mobile app, the transition IS allowed, then it is reversed after a few seconds. This indicates that the verification takes place after the move, and it is not prevented as in the browser app.

So far, that's about it.

saqib.ahmed
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 6, 2023

@Hugo Gómez Instead of doing this whole workaround, isn't it easier to just use the admin user (or your own user) as the automation rule's actor? Then in the workflow, only allow the automation rule's actor to make the said transition.

 

At any rate, the user who's configuring the label to be added and removed can do that manually as well. With him being the actor of the rule, only he'd be able to make the transition either manually or via the automation rule. The same effect would be achieved as previously without any loophole. 

 

Screenshot 2023-02-06 at 1.01.57 PM.png

Like Arundas TC likes this
1 vote
Brendan Sheppard October 24, 2023

@Hugo  thanks for your solution on this, worked well for my need today in cloud version.

I needed this today and like the original poster, it seems like an easy fix for the 'Automation for Jira' role to be selected as the role who can transition, would save the fiddling.  Sometimes you think the people that build these system don't have to use it.

1 vote
George Bou-Rizk July 11, 2023

I can suggest a solution for you if anyone is still struggling with this.

You want to change the properties of each status that you want to restriction transitions for and limit it to only the automation.

To do this you have to do the following:

1) Find out what your automation id is:
      a) Go to System SettingsScreenshot 2023-07-12 082250.png

    b) Click view usage for atlassian-addons-project-access
    c) the automation id is in the url
     Screenshot 2023-07-12 082451.png

2) Go to your workflow, select the status you want to restrict transitions, click on the status then click on properties under Options

Screenshot 2023-07-12 082938.png

3) Add the condition for automation to have permission

   a) Set the property key to jira.permission.transition.projectrole.1

   b) Set the property key to the automation Id you obtained from previously

   c) click the add button

Screenshot 2023-07-12 083159.png

You're done!

Now, only automation will have permission to transition any ticket that has that status.

You will need to repeat the process for every status that you want to restrict to only automation.

Antonio Spanò
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 3, 2023

Hi George,

 

I've tried to manage the workflow permission like you suggested, but i still receive an error in the automation did by "Automation for Jira" user:

 

Annotation 2023-11-03 145208.png

 

Any idea?

 

Thanks

George Bou-Rizk November 3, 2023

I believe that is a permission that you have not enabled in your projects permissions.

 

In your project on the left navigation panel, Click "Project Settings", then click on "Permissions".  

Try update the permission, "Transition Issues" to grant permission to:

Project Role: "atlassian-addons-project-access"

You maybe also "browse projects" permission. If in doubt just grant Project Role: "atlassian-addons-project-access" all permissions 

1 vote
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2021

is this a classic project? If so, I would suggest a Condition on the transition within the workflow.

Mashu Duek February 13, 2021

Hey Jack, thanks for reply. 

It is not a classic project, its a next-gen software project. 

In the workflow, to the transition I can apply "Rules", the one I wish to apply is "Restrict who can move an issue", I can't figure out how to allow only the Jira Bot (the trigger automation software) to make the transition. 

Phil Walburn August 14, 2021

Hey Mashu,

Did you ever get this to work ?

I am trying to do the same, and have hit the same wall

I have existing Rules in place, and want to add the "Automation for Jira" User as an additional user allowed to Transition, but it is failing at the moment

(It works if I take all Rules away, but that does suit my requirements)

thanks

Phil

Mashu Duek August 16, 2021

Hi Phil, 

 

I did not get it to work, unfortunately. This is a limitation of next-gen projects I believe. 

Manuel Venegas
Contributor
April 4, 2022

Hi @Jack Brickey which condition would you suggest as the optimal? I've been looking around and I was considering the 'automation for jira' user for example, the problem is that is not a real user so I can't add him into a user group and use that as a condition for example. What would you suggest?

Like Marta Perez likes this
Marta Perez September 23, 2024

Hi @Jack Brickey I am also trying to set up the conditions to apply to the Automation for jira. How do you suggest we build it?

thanks

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 23, 2024

Hi @Marta Perez , if you are inquiring as to how to restrict a Workflow Transition such that no users can transition but automation for Jira can, I believe the following will work.

Add a User in group Condition to the transition and choose "atlassian-addons-admin" in the group selection.

Suggest an answer

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

Atlassian Community Events