JQL with Smart Values in Jira Automation

Wafa Hasnaghina Ulfah May 14, 2024

Hi everyone,

Why am I unable to get a result of this JQL in my automation rule?

project = "{{issue.project.key}}" AND (status= "In Progress" AND issuetype = Subtask AND updatedDate <= "-1d")


I want to automatically detect the project based on the issue.

thank you

 

2 answers

2 accepted

0 votes
Answer accepted
Rik de Valk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 14, 2024

Hi @Wafa Hasnaghina Ulfah , 

I noticed that using 'project in' instead of 'project =' does the trick. 

I tried this using a Manual trigger in combination with Lookup issues actions. And that works fine.  

Screenshot 2024-05-14 at 14.17.35.png

Hope that helps. 

Rik 

Wafa Hasnaghina Ulfah May 14, 2024

Hi @Rik de Valk 

thank you for the reply.

Yes, I tried with the project in ("{{issue.project.key}}") and it immediately and successfully triggered when I used the JQL Condition.

JQL Condition.PNG

It turned out that the Scheduled Trigger with JQL that I use, returns the value of the project without needing to specify, so it kind of caused the error.

0 votes
Answer accepted
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.
May 14, 2024

Hi @Wafa Hasnaghina Ulfah , this bit of you JQL is invalid - project = "{{issue.project.key}}"

you mention that you want to detect project based on the issue. I assume that you are referring to the trigger issue. Might I ask why you want to detect the project? What do you want to do with it precisely? Do you want to somehow use it in an action? if you can provide more details to your actual used case I might be able to assist further. 

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.
May 14, 2024

If you want to retrieve the project key for the triggered issue use {{project.id}}. If you want something different (project name, ID, etc.) check out this documentation resource - jira-smart-values-projects .

Wafa Hasnaghina Ulfah May 14, 2024

Hi @Jack Brickey 

Thank you for the reply.

I want to create a global automation rule, so I need to use the specific issue project key to find the issue in the project that I want.

It turned out the JQL worked perfectly fine when I used it in the JQL Condition.

However, it did not work because I used Schedule Trigger with JQL, and the result didn't match because the Schedule Trigger automatically translated the project, as shown in the image below.

project.png

it worked perfectly fine now as I deleted the project in ("{{issue.project.key}}")

success.PNG

and I think the JQL work based on the trigger that we use.

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.
May 14, 2024

sounds like you are good to go? please consider accepting the answer if so.

Suggest an answer

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

Atlassian Community Events