Missed Team ’24? Catch up on announcements here.

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

Automation Lookup issues fails to find

Aron Kuch April 4, 2024

I am building an automation to link issues with the same external ID to across projects in Jira. I tried using the Lookup issues action. I started with

Jira Automation Lookup Issue.png

But it fails to find anything. From the Audit Log:

Jira Automation Lookup Fail.png

I replaced the {{issue.REDCap ID}} with an actual value, 1102, and still received that "result". The JQL with a set value works when used in Issue Search and it returns one record like it should.

Jira Issue Search.png

Do I need to use the custom field id number in the automation JQL? Any other ideas why it isn't returning results?

4 answers

1 accepted

1 vote
Answer accepted
Kalyan Sattaluri
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 4, 2024

Hello @Aron Kuch  As @Mark Segall  has suggested do try surrounding it in quotes... But one other thing, You mention you are searching across projects, please also make sure your rule scope has "MAIN" project included. If you dont have scope, you wont have hits.

Aron Kuch April 4, 2024

Ah, rule scope. I had set it to one project because I just wanted the one project to link back to the first. But appears to have limited the JQL  search to just that project.
I changed to Global scope, multiple projects could also have worked, and it ran. Thank you.
I assumed that issues in MAIN would now trigger it when there REDCap ID field was populated, so I created an condition component to filter to just issues on the project that I want the run to trigger on. When I tested with a MAIN issue, the rule started, but terminated when the " issues did not match the condition".
Thank you again, this solves this part of the automation.

Like Kalyan Sattaluri likes this
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.
April 4, 2024

Hi @Aron Kuch 

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

 

Smart values are name, spacing and case-sensitive.  And, often the smart value does not match the displayed field name on the views.  When the incorrect smart value is used, it often fails silently, as you see with no issues found for the lookup issues action.

To confirm that JQL is using the correct smart value for your field, please use this how-to article.  Essentially, you use an example issue with your field, call a REST API function with a browser, and search for your field on the page to find the correct smart value (or custom field id).

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

 

Kind regards,
Bill

0 votes
Mark Segall
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 4, 2024

Hi @Aron Kuch - I believe what you have will work, but you need quotes.  Try this:

project = MAIN AND "REDCap ID" ~ "{{issue.REDCap ID}}"
Aron Kuch April 4, 2024

Reasonable, but I tried that and didn't resolve.

0 votes
Mauricio Heberle
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 4, 2024

This lookup wont work, you are telling jira "look for a project = main and a field called "REDCap ID with a literal text value {{issue.REDCap ID}}. Thats why your second print works. 

Heres some documentation:
https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#CONTAINS----
https://support.atlassian.com/jira-software-cloud/docs/search-for-issues-using-the-text-field/
https://confluence.atlassian.com/automation074/text-functions-1141481322.html

Using vanilla JQL, i dont think its possible to compare strings. Firtst idea that comes to mind is that you will need to create a variable (create var component) and compare it using a string function.

Create var = REDCapId

{{issue.REDCap ID.match("REDCapId")}}

That would take some testing.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events