JQL Query for linked issue not working as expected.

Jenifer Kuntz
Contributor
November 13, 2023

I am creating an automation rule and doing an issue lookup with the following JQL

issue in linkedissues({{issue.key}}) and issueLinkType in ('parent story')

What I expect it to do was pull the issues that were linked to the issue with a parent story link type.

What it is doing is pulling the the issues linked to the issue then looking at those issues and seeing if they have a parent story link.

I put the query in the navigator with the same results.

issue in linkedissues("ISSUE-123") and issueLinkType in ('parent story')

For example 

My issue ISSUE-123 has the following linked issues:

ISSUE-124 (parent story Link)

ISSUE-125 (relates to Link) This issue has a parent story link to ISSUE-111

ISSUE-126 (relates to link) No Parent story link.

The quesry is pulling all three issue.

I am adding a number field from the linked issues. In this case I would Only want it to look at ISSUE-124 but it is adding the value from ISSUE-124 and ISSUE-125 because they both have parent story links.

Any idea on how I can have it only pull the parent story link of the initial issue.

Thanks!
Jenifer

 

 

3 answers

3 accepted

0 votes
Answer accepted
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.
November 13, 2023

Hi @Jenifer Kuntz 

I believe that JQL is getting the superset of what you want: any issues linked to the target issue and which have any links of that type to any issue (not just the target one).

If you specifically want the issues of that type, linked to the target issue, please try this syntax:

issue IN linkedIssues("{{issue.key}}", "parent story")

https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#linkedIssues--

Kind regards,
Bill

Jenifer Kuntz
Contributor
November 17, 2023

Thank you!  This worked.

Like Bill Sheboy likes this
0 votes
Answer accepted
Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 13, 2023

Hi @Jenifer Kuntz so it's reading both clauses and returning true on both.  I'd suggest you review using smart values here's a couple pages for your review.  Hope this helps.
jira-automation-conditions 
jira-smart-values-conditional-logic 

Jenifer Kuntz
Contributor
November 17, 2023

Hi Craig, thank you for responding.

In my case, I need the issues to be in the Lookup Issues because I am using that in a calculation so needed it in a JQL. Bill's answer worked for me.

Like Craig Nodwell likes this
0 votes
Answer accepted
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 13, 2023

@Jenifer Kuntz

 

You should insert a branching action and branch on the "Parent" issue. That will allow you to pull the parent of the current ticket.

Jenifer Kuntz
Contributor
November 17, 2023

Hi Kian,

Thank you for responding.

In my case, I need the issues to be in the Lookup Issues because I am using that in a calculation so needed it in a JQL. Bill's answer worked for me.

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