In a Jira automation, I cannot get a JQL query to work with lookup and a smart value. The smart value itself ({{comment.body.match("([A-Z]+-\d+)").first}}) works fine i.e. it looks correct when printed to a comment in the same Jira automation flow, but it returns 0 results when used in a lookup (according to the audit log of the automation). I can confirm that when used in a comment, the value of the smart value is correct, so unsure why it cannot be used in a lookup? I've also tried setting it to a dedicated var as a step in between but that didn't work either. Thanks!
Hi, Tim -- Welcome to the Atlassian Community!
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
Some rule actions can have order-of-evaluation / timing problems when evaluating smart value expressions. The Send Web Request action definitely has this problem, and perhaps the JQL for Lookup Issues does also.
The way to check if this is the cause (and to solve it) is to first store the result of that expression using the Create Variable action. Then use that created variable in both your Log and the Lookup Issues action.
Kind regards,
Bill
Hello Tim,
My Name is Saurabh Kapoor one of the Support Engineers here, and I will be happy to help you on this issue.
Thank you for reaching out to the Atlassian Community. I understand you're experiencing an issue with using a smart value in a JQL query within Jira automation. It's great to hear that the smart value works correctly when printed to a comment, but I can see how it would be frustrating for it not to work in a lookup.
Based on the information available, it seems that the issue might be related to the pattern used in your smart value. The solution provided in the Atlassian content suggests modifying the regular expression pattern slightly. Here's what you can try:
Solution:
{{comment.body.match("([A-Z]+-\d+)").first}}
, try using {{comment.body.match("([A-Z0-9]+-\d+)").first}}
. This pattern includes numbers in the project key part of the issue key, which might be necessary for your specific use case.This adjustment should help the smart value work correctly in the lookup context as well. If the issue persists, ensure that the smart value is correctly set and that there are no additional constraints in your JQL query that might be affecting the results.
I hope this helps resolve your issue. If you have any further questions or need additional assistance, feel free to reach out. We're here to help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.