Branch in automation not finding related issues

Dennis Rünzler April 17, 2024

Hello everybody,

I am having issues with one automation rule.

What I want is rather simple. Due to company rules, it is mandatory for each user to only have 1 Issue in the status "in Progress" for a specific project at a time. So the easiest way is to just transition all other issues (should only be 1 or 0) to another status whenever an issue is tansitioned to "in Progress".

The rule setup is rather simple:

AutomationRule1.PNG

But whenever I put a second Issue in the status, the audit log tells me, there are no related issues. The JQL finds 2 issues, which is correct, since I am triggering it by moving a second issue to the status. The rule is limited to a single project, so this should not be an issue either.

Any ideas why this wont work?

Best Regards

Dennis

3 answers

1 accepted

2 votes
Answer accepted
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.
April 17, 2024

Hi @Dennis Rünzler 

In my opinion, working on one thing at a time until done is great for managing WIP, reducing team stress, and to improve value delivery flow.  Yet, using an automation rule to manage that may create unintended consequences of people hiding work, or no longer tracking work in Jira.  Additionally, this rule can be circumvented by only assigning people after the transition to "In Progress".

I recommend discussing with teams why they feel they need to have more in progress, and try to address those concerns.  Otherwise edge cases will also cause new challenges.  (For example, if there is an expedited prod support issue, does something need to move out of in-progress before the support issue can be addressed?)

 

Back to your automation rule...the JQL branch should test for the initiator and not the current user:

project = yourProjectName AND assignee = {{initiator}} AND status = "In Progress"

Kind regards,
Bill

Dennis Rünzler April 18, 2024

Hi @Bill Sheboy

thank a lot. This gave me the right idea. I changed the JQL to this and it worked just fine ;)

assignee = {{triggerIssue.assignee}} and status = 'In Progress'

 The original one always got "Automation for Jira" as currentUser, and this user never has any assigned issues. So the idea with smart values did the trick.

Best Regards

Dennis

1 vote
Valerie Knapp
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 17, 2024

Hi @Dennis Rünzler , thanks for your question.

I think you might need to add a 're-fetch issue data' action after the condition, in the branching.

I think if you are saying, in the same moment as the transition, to do this comparison and then take an action based on the outcome of the comparison, it might be necessary to refresh the data so that the action can proceed, if that makes sense.

Can you test that and give us your feedback if it helps?

Cheers

 

Dennis Rünzler April 17, 2024

Hi @Valerie Knapp ,

I added a refetch before and after the branching. The first one triggers, but the branch still says there are no related issues. So the second refetch and the transition are not executed. There should be two (or, if the triggering issue itself does not count here, it should be at least one)

 

Cheers

0 votes
Mike Anderson
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!
July 2, 2024

I had the same problem.  If I run the automation (manually) on the issue I am trying to branch on (i.e.  JQL is  "issue = {dev-xxxx}" and I am on issue dev-xxxx) then the JQL query fails and it cannot find any issues.  If I am on another issue, then it works fine.

 

 

Suggest an answer

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

Atlassian Community Events