Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

OR operator in automations?

Ada April 11, 2022

In Jira service management, I have a couple forms created for managers to fill out when an employee or contractor are onboarding, and each created a ticket of either the employee-onboarding or contractor-onboarding type.

In the forms are checkboxes that can be selected to trigger an automation that create a subtask to create an account in one of our systems. There are a couple systems where we always create an account for employees but only sometimes create an account for contractors (e.g. company email account). Due to this difference there are two different kinds of checkbox fields, called required-accounts and required-accounts-contractor.

Is there a way to make it so an automation that creates a subtask to create an account in our password manager triggers if a ticket of the employee-onboarding type is created and in the required-accounts field the checkbox for the password manager is selected OR if a ticket of the contractor-onboarding type is created and in the required-accounts-contractor field the checkbox for the password manager is selected? These two events would have the same outcome.

If only the ticket type was different this would be simple, but since the employee and contractor required accounts fields are different I'm running into trouble trying to figure this out. I would prefer to not have to create a separate automation if possible.

1 answer

1 accepted

2 votes
Answer accepted
Fernando Eugênio da Silva
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 11, 2022

@Ada , welcome to the Atlassian Community!

You can use a JQL condition for this case, try something like:

JQL: "customfield A" is not EMPTY OR "customfield B" is not EMPTY

So Jira will read if any of the two fields are filled in the ticket and will work normally without having to split it into 2 automations.

Try this and see if the result looks good to you.

Ada April 13, 2022

This is probably the way to do it, but I don't see how to do this if a certain value in a set checkbox list is checked. For example,I need it to trigger if Required Accounts or Required Accounts - Contractor contains i.e. LastPass, so I tried

"Required Accounts" ~ "LastPass" OR "Required Accounts - Contractor" ~ "LastPass"

using ~ for contains per the JQL operators doc, but it returns

Invalid JQL: The operator '~' is not supported by the 'Required Accounts' field.
Fernando Eugênio da Silva
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 13, 2022

You are using "Required Accounts - Contractor", but Jira is reporting that the "Required Accounts" field is the one experiencing problems.

Can you confirm what the correct field name is? Also, is it a select list or single text field?

This will help to better identify the cause and help you.

Ada April 13, 2022

It is just only showing the first error; if I remove the content before the OR it will give the same error but with the other field.

 

The field names are correct. It is a checkbox field with multiple options.

Fernando Eugênio da Silva
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 13, 2022

The JQL for checkbox fields are:
"Required Accounts - Contractor" = "LastPass"

You are using > Required Accounts - Contractor" ~ "LastPass"

Understand the difference of ~/=

I think the problem may be there.

I would recommend that you first assemble this JQL using the "Search issues" feature in Jira. When you get results from issues, then just use the same JQL in automation and it will work.

Ada April 13, 2022

The checkboxes each trigger their own automation, and multiple checkboxes can (and likely will) be selected. If I use = won't it only work if that is the only checkbox selected? I used ~ because I need it to trigger to create a ticket for creating a LastPass account if LastPass is selected and also if LastPass and AWS are selected

Fernando Eugênio da Silva
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 13, 2022

In this case, if you want the field: "Required Accounts - Contractor" to make your automation work with more than one option contained, you should use the following JQL:

"Required Accounts - Contractor" IN ("LastPass", "AWS")

If any "Required Accounts - Contractor" option should make the automation work, you should use:

JQL> "Required Accounts - Contractor" is not EMPTY

So if the field has any of these values the automation will work.

Using "~" only works for text fields, it doesn't work for select list fields

Ada April 13, 2022

That did it, thank you!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events