Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA automation not running if I have a OR statement in my JQL used in board

Steven Dos Ramos
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!
June 27, 2025

Hi there,

 

Would appreciate some help. I have a project that has multiple teams that work on the project, I am trying to set a automation so when each team board is used, it will automatically set the team and component for any new tasks created so that the ticket does not get removed from view in the board.

For example, if manufacturing board is used with this JQL:
project = "Olarm HUB" AND ("Team[Team]" = "f713efbd-6159-460e-bcc4-2cd2186b2446" OR component = "Manufacturing ") ORDER BY Rank ASC

Then set the team and component to manufacturing automatically. To do this, I set the component  field to manufacturing and also set additional fields using the following where the ID is the manufacturing team:
{
"update": {
"customfield_10001": [
{
"set": {
"value": "7470ee42-cf78-434a-9bc6-d20d5be2953b"
}
}
]
}
}


This above automation does not work at all when using the same JQL in the board and when also used in the If statement of the automation. 

It only seems to run the automation successfully when I do not include a OR statement in the board and automation JQL. In other words, if I use the following JQL and the same if in the automation then the automation step to set the component and additional fields works 100%:

project = "Olarm HUB" AND "Team[Team]" = "f713efbd-6159-460e-bcc4-2cd2186b2446" ORDER BY Rank ASC

How do I achieve the automation when using the board with JQL that includes the following JQL:
project = "Olarm HUB" AND ("Team[Team]" = "f713efbd-6159-460e-bcc4-2cd2186b2446" OR component = "Manufacturing ") ORDER BY Rank ASC


4 answers

0 votes
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.
June 28, 2025

Hi @Steven Dos Ramos -- Welcome to the Atlassian Community!

As @Walter Buggenhout describes, although a board has a filter to manage which work items display, neither JQL nor automation "know" anything about boards.  For rules, it is all about the data.

To that point, one possible cause for the symptom you describe it a known problem with the Work Item Created rule trigger: the rule can start running so quickly some data may not yet be available to the rule.  This can cause strange errors or conditions to not be met.  Seeing the audit log details for your rule will confirm this.

The mitigation for this challenge is to always add the Re-fetch Work Item Data action immediately after the Work Item Created trigger.  This will slow the rule slightly and reload the data before the other steps proceed.

  • trigger: Work Item Created
  • action: Re-fetch Work Item data
  • ...more rule steps

 

Kind regards,
Bill

0 votes
Walter Buggenhout
Community Champion
June 28, 2025

Hi @Steven Dos Ramos,

There is absolutely nothing in the automation rule you are trying to build that requires a reference to your board. A filter of a board does not impact an automation rule either (even generally speaking).

It seems you are just trying to automate setting the value of 2 fields when an item is created in your project.

If you make sure your automation rule is a local rule in your project, you don't need to apply any conditions at all. Just use the work item created trigger, remove the condition and then execute the action as it is in your rule. That should set the component and team as in your example.

If that is not what you want to do, can you be more clear on what you are trying to achieve with your filter condition?

Also, if you get any errors in the rule audit log, please share those as well.

Hope this helps!

Steven Dos Ramos
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!
June 28, 2025

 Hi Walter,

Thanks so much for taking the time to help - really appreciate it! Let me try to clarify our setup and the goal, in case I wasn’t clear before:

We have a shared project (Olarm HUB) that spans multiple teams, including Marketing, Manufacturing, Hardware, Development, Sales, Industrial Design, and others.

Each task can:

  • Be owned by one team (Team[Team] field)
  • Have one or more components (e.g., a Manufacturing task might include both “Manufacturing” and “Hardware” components)

Each team works from a dedicated board that filters tasks either:

  • Assigned to their team, or
  • Tagged with components relevant to their function (even if they don’t own the task)

Example — Manufacturing Board Filter:

project = "Olarm HUB" AND ("Team[Team]" = "f713efbd-6159-460e-bcc4-2cd2186b2446" OR component = "Manufacturing ") ORDER BY Rank ASC

What I'm Trying to Do:

When the Manufacturing team plans work on their board and creates a new task, I want automation to:

  • Automatically set the Team field to "Manufacturing" (Team[Team])
  • Add the "Manufacturing" component

That way, the task doesn’t disappear from their board due to missing filters. 

I seem to have this working in an automation across teams if the jira board query is set simple: project = "Olarm HUB" AND ("Team[Team]" = "f713efbd-6159-460e-bcc4-2cd2186b2446" 
i.e without the OR statement to include components. The automation works great but as soon as both the JIRA board and JQL is set to include components, then it simply doesnt run.

Thanks and hope you can help. 

Walter Buggenhout
Community Champion
June 28, 2025

Thank you for the additional context, @Steven Dos Ramos! That is pretty extensive 😅

I understand your setup with different boards. But do forget about the board in context of your automation rule. All that matters there is the condition you are trying to apply - the board does not impact that in any way.

A couple of things:

  • Since your trigger listens to the work item created event, I hope we can safely assume that a team and/or component are indeed being filled out when users create a task in your project. That will be a necessary requirement for any further steps down the road.
  • Select fields on work items can be tricky to filter on sometimes, especially if they can be empty. When including a search for components, I would recommend to update your filter so it contains  "... OR (component IS NOT EMPTY AND Component IN (Manufacturing))
  • If you can't get this to work (I have no immediate idea why it wouldn't, but still), you might be able to use an IF ... ELSE condition in your automation rule instead of the JQL condition, as it allows you to split your OR statements into separate conditions. See the below example on what that might look like:

Screenshot 2025-06-28 at 10.55.21.png

0 votes
Steven Dos Ramos
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!
June 27, 2025

So automation with a simple JQL works fine, here is the board filter:
image.png

 

Here is the successful automation:


image.png

 

But if I have the JIRA board set with the following JQL for both, the automation does not work and does not successfully set the component and team:

project = "Olarm HUB" AND ("Team[Team]" = "f713efbd-6159-460e-bcc4-2cd2186b2446" OR component = "Manufacturing ") ORDER BY Rank ASC

Not including screenshots, it would be the same structure of the trigger details but with the above JQL


0 votes
arielei
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.
June 27, 2025

Hey @Steven Dos Ramos 

Pls add a screen shot of the trigger details in your automation.

Thanks.

Steven Dos Ramos
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!
June 28, 2025

Thanks @arielei , please see above

Suggest an answer

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

Atlassian Community Events