JQL - issue did not match the condition when it should.

Ramon Mengarda February 15, 2024

I have two types of issues: "Ticket" and "PCR". When I create a PR for a ticket, I create a PCR using an automation. I link a Ticket and a PCR through the linked issues field
jira1.png

Later on the flow, I call a webhook to update the status of my ticket, and I want to update the status of the PCR as well. In order to do that, I created this automation:
jira2.png

In the first step I receive the Tticket number through the body of the webhook request, the I transition the Ticket, then I use the JQL

issue in linkedIssues({{triggerIssue.key}},"is included in")

and lastly I use an HTTP request to update the PCR status.

 

The problem I'm facing is that the JQL is not returning what I expected, given that I see this on the audit logs for the automation:jira3.png

As I described, there IS a linked issue for RFM-38, which should be RFM-39, but for some reason the JQL can't find it. Can someone help me?

 

2 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.
February 15, 2024

Can you do normal JQL search in Jira by the ticket to see if you are getting RFM-39? I dont see any issue with your query..

 

issue in linkedIssues("RFM-38","is included in")

Ramon Mengarda February 15, 2024

I can, and it returns the correct result.jira4.png

Ramon Mengarda February 15, 2024

Can it be the quotation marks? I'm gonna try that

 

Ramon Mengarda February 15, 2024

Yep... that wasn't it :/

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.
February 15, 2024

@Ramon Mengarda  I just checked and yes, the if condition though passes, its not doing next steps for me as well. While we think that through...

Can I suggest, instead of If Condition with JQL, change it a branch -> for linked issues -> link type = "is included in"..

and then you log to see if its working?

I tested and this worked..

Like Ramon Mengarda likes this
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.
February 15, 2024

Of course below screen shot shows different link type, but something similar

image.png

Ramon Mengarda February 15, 2024

Worked like a charm, and it's a more elegant solution to my problem, so I'm taking this as standard now lol. Thank you!

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

Thinking further on original issue, *my theory* is that for linked issues check, there is a specific If condition.. If "linked issues present"..

so if we just want to check if certain link type exists, we have to choose that option instead of JQL route.. (not sure why)

and if we have to loop through all linked issues, we branch like you did.

 

So I guess in summary, if you have to "send web request" for each linked issue --> branch,

And if all you need to do is send just 1 web request, use the If -> linked issues present check..

Learnt this behavior through your post, thanks!. 

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.
February 15, 2024

Hi @Ramon Mengarda 

I note in your Send Web Request action, you appear to be trying to use the result of a Lookup Issues action in the URL.  But the rule has not used that action first.

If you need that, please write JQL to find the relevant issue(s), add the Lookup Issues action to find them, add a condition to confirm issues were found, and then use that result in your URL. 

I noted the smart value in your URL is also incorrect as it has a typo.  This may be the one you wanted:

{{lookupIssues.first.key}}

 

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events