Forums

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

Jira Automation - Issue in creating rule for multiple look up values

Naveen Chauhan January 12, 2025

Hi everyone,

I need help creating an automation rule in a Jira company-managed project.

Here’s what I’m trying to achieve:

  • I have a custom field of type "text" called "Plugin ID", which contains various values (e.g., 180123, 172345, 201298, 327186, 345231, etc.).
  • I want to create an automation rule that:
    1. Checks for specific values in the "Plugin ID" field.
    2. Updates another custom field called "Action" based on the matched values.

Desired Rule Behavior:

  • If "Plugin ID" is 180123 or 201298, set "Action" to update.
  • If "Plugin ID" is 172345, 327186, or 345231, set "Action" to configure.

The challenge I’m facing is understanding how to define a single rule condition that looks up multiple values for this field.

Any guidance or examples would be greatly appreciated!

2 answers

2 votes
Rilwan Ahmed
Community Champion
January 12, 2025

Hi @Naveen Chauhan ,

Welcome to the community !!

You can achieve this by using "Add a Branch" --> Current issue 

For "IF: Add a condition", select Issues Matches JQL
Add JQL condition as "Plugin ID" in (180123, 201298)

For Then: Add an action, select Edit issue --> select Action field and set value 'update'

Add one more branch and create same rule like above for "Plugin ID" in (72345327186, 345231)

Your rule should look like this. Please note: I have used Epic name and Priority in my jira as an example and created for Create issue action. You can create same for Create issue, Edit issue etc.

image.png

Naveen Chauhan January 13, 2025

Hi @Rilwan Ahmed , I did try that rule but I am getting this error when validating the rule

I believe the field type "text" doesnot support "in" operator

 

SCR-20250113-raey.png

Rilwan Ahmed
Community Champion
January 13, 2025

Hi @Naveen Chauhan 
What is the custom field type for "Tenable Plugin ID" ?  
You can find it in https://<your domain>.atlassian.net/secure/admin/ViewCustomFields.jspa

If its a text field, then you need to make use of "~" in the search

Example JQL: 

"Affected hardware[Short text]" ~ Laptop OR "Affected hardware[Short text]" ~ Pc

Mode details about text search is in https://support.atlassian.com/jira-software-cloud/docs/search-for-issues-using-the-text-field/

Naveen Chauhan January 13, 2025

Hi @Rilwan Ahmed , 

The problem is i have heaps of values under Plugin ID , atleast 150

using "~" in the manner as you shown above would be impractical i believe.

also i dont know whats the limit in the JQL query of additional "OR" statements

 

I was also thinking of creating a database with the Tenable Plugin IDs; but i dont know how to compare the values in the field from this database and set Action field

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.
January 13, 2025

Hi @Naveen Chauhan -- Welcome to the Atlassian Community!

Your rule could use the Smart Values Condition with a regular expression to test for the different values: https://support.atlassian.com/cloud-automation/docs/jira-automation-conditions/#--smart-values---condition

Also: what value should be set in the "Action" field if both conditions are met?  This appears to be possible as your "Plugin ID" field is text, with no constraints on selected values.

Kind regards,
Bill

Naveen Chauhan January 13, 2025

Hi @Bill Sheboy ,

If one of the two conditions  match the Action field should set to "OS Update" and for second condition match set the field to "Configuration change" 

 

I'll give it a go of your suggestion to use smart values.

Like Bill Sheboy likes this
Naveen Chauhan January 15, 2025

Hi @Bill Sheboy 

I am unable to use the smart values created.

I was able to create a look table for the Tenable Plugin ID.

But somehow, I am unable to use in the rule

The log suggests that the automation task to create the lookup table was successful

However I cant able to locate the keys created in the table 

Please see screenshots SCR-20250116-nhno.pngSCR-20250116-nhwm.png

What am. i doing wrong?

 

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.
January 16, 2025

Why are you using a Lookup Table?  That will not work for this scenario because the "Plugin ID" field may contain multiple values.

And why is your rule using a Scheduled Trigger?

 

An example rule using the smart values condition would be:

  • trigger: issue field changed for "Plugin ID"
  • if  / else block
    • smart values condition
      • first value: {{issue.Plugin ID}}
      • condition: contains regular expression
      • regular expression: (180123|201298)
    • action: edit issue to set the Action value
  • else / if
    • ... repeat above for other selections

 

You will need to confirm the correct smart value for the "Plugin ID" field.  Use this how-to article to do that: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

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