Jira JQL error I cannot fix....
Asked by Brian Jackson:

    project IN (RITACP, RITDSM, RITAMC, RITAME, RITDFS, RISCO, RITAFBM, RITAMP, RITDFDO, RITAMPI, RITCRCL, RITAFLE, RITDLM, RITDDC, RITAIO, RITAIVN) AND (    (issuetype = Initiative AND "XYZ" = "ABC")    OR issueFunction IN linkedIssuesOf('project IN (RITACP, RITDSM, RITAMC, RITAME, RITDFS, RISCO, RITAFBM, RITAMP, RITDFDO, RITAMPI, RITCRCL, RITAFLE, RITDLM, RITDDC, RITAIO, RITAIVN) AND issuetype = Initiative AND "XYZ" = "ABC"')    OR issueFunction IN linkedIssuesOf('issuetype = Epic AND issueFunction IN linkedIssuesOf("project IN (RITACP, RITDSM, RITAMC, RITAME, RITDFS, RISCO, RITAFBM, RITAMP, RITDFDO, RITAMPI, RITCRCL, RITAFLE, RITDLM, RITDDC, RITAIO, RITAIVN) AND issuetype = Initiative AND \"XYZ\" = \"ABC\"")'))

Error in the JQL Query: Expecting ')' or ',' but got 'Key'. (line 1, character 232)

This query works when I am not trying to get issues linked to epics but just pull Initiatives and Epics. When I try to add all linked issues, I get the error above. Any help would be appreciated.


Answers:
author: Trudy Claspill
body: Hello [@Brian Jackson](/t5/user/viewprofilepage/user-id/5545416)

Welcome to the Atlassian community.

Your post tags say you are using Jira Cloud. I'm going to assume that is correct.

The "issueFunction IN linkedIssuesOf()" portion is not natively available in Jira JQL. Do you have a third party app such as ScriptRunner Enhanced Search or JQL Extensions installed? If so, it is that third party app that makes that syntax available.

In general that syntax can't be used directly in the native Jira issue search screens. For ScriptRunner there is actually a separate Enhanced Search screen where you have to create the JQL statement with that syntax:

![Screenshot 2024-07-16 at 11.28.37?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/335955i0CA4D9644CB3CD38/image-size/large?v=v2&px=999 "Screenshot 2024-07-16 at 11.28.37?AM.png")

You create the JQL statement there and save it, then in the native Jira issue search screens you can reference it with the syntax:

filter="*put the name of the saved filter here*"

comments: author: Brian Jackson
body: Thanks,

Looking at ScriptRunner now in hopes it solves my issue.

appreciate the suggestions.

-B


author: Trudy Claspill
body: Hello [@Brian Jackson](/t5/user/viewprofilepage/user-id/5545416)

I was looking at the error message again, and think I made a mistake in my suggestion.

The message says it expect ')' but found 'Key'. However, 'Key' doesn't appear anywhere in the JQL you posted.

Can you double check that you posted the correct correct JQL? Can you show us the screen with the JQL and the error message displayed at the same time.


author: Brian Jackson
body: project IN (RITACP, RITDSM, RITAMC, RITAME, RITDFS, RISCO, RITAFBM, RITAMP, RITDFDO, RITAMPI, RITCRCL, RITAFLE, RITDLM, RITDDC, RITAIO, RITAIVN) AND (  
(issuetype = Initiative AND "Key Research Technology Enablers" = "In-Vivo Workflow Simplification")  
OR issueFunction IN linkedIssuesOf('issuetype = Initiative AND "Key Research Technology Enablers" = "In-Vivo Workflow Simplification"')  
OR issueFunction IN linkedIssuesOf('issuetype = Epic AND issueFunction IN linkedIssuesOf("issuetype = Initiative AND \\"Key Research Technology Enablers\\" = \\"In-Vivo Workflow Simplification\\"")')  
)

Sorry, in an attempt to scrub industry terminology I replaced the In-Vivo Workflow Simplification and Key Research Technology Enablers with ABC, XYZ.

I think your response may be the same, but, I posted the error causing query above.


author: Brian Jackson
body: ![atlassian image.png](https://community.atlassian.com/t5/image/serverpage/image-id/337961i6D876B70AB539762/image-size/large?v=v2&px=999 "atlassian image.png")


author: Trudy Claspill
body: So, the error message is not coming from a native JQL filtering field, but rather from some third party plugin interface. What plugin are you using there?

Let us also confirm the hosting/version of Jira you are using. In the upper right corner on the menu bar near your Avatar there should be a "help" button labeled with a question mark. When you click that button and select About Jira, what information do you get?

I'm having a hard time figuring out which instance of **Key** within the JQL the message is reference. It says line 1, char 83, but **Key** doesn't appear at the 83rd character of any line.

I suggest that you try building up the query in segments to try to identify the segment causing the problem. First try individually just the segments that include **Key**

issuetype = Initiative AND "Key Research Technology Enablers" = "In-Vivo Workflow Simplification"

issueFunction IN linkedIssuesOf('issuetype = Initiative AND "Key Research Technology Enablers" = "In-Vivo Workflow Simplification"')  

issueFunction IN linkedIssuesOf('issuetype = Epic AND issueFunction IN linkedIssuesOf("issuetype = Initiative AND \\"Key Research Technology Enablers\\" = \\"In-Vivo Workflow Simplification\\"")')  

If none of them individually generate the error then try building up the query by combining them

(issuetype = Initiative AND "Key Research Technology Enablers" = "In-Vivo Workflow Simplification") OR issueFunction IN linkedIssuesOf('issuetype = Initiative AND "Key Research Technology Enablers" = "In-Vivo Workflow Simplification"')

(issuetype = Initiative AND "Key Research Technology Enablers" = "In-Vivo Workflow Simplification") OR issueFunction IN linkedIssuesOf('issuetype = Epic AND issueFunction IN linkedIssuesOf("issuetype = Initiative AND \\"Key Research Technology Enablers\\" = \\"In-Vivo Workflow Simplification\\"")')

issueFunction IN linkedIssuesOf('issuetype = Initiative AND "Key Research Technology Enablers" = "In-Vivo Workflow Simplification"') OR issueFunction IN linkedIssuesOf('issuetype = Epic AND issueFunction IN linkedIssuesOf("issuetype = Initiative AND \\"Key Research Technology Enablers\\" = \\"In-Vivo Workflow Simplification\\"")')


Tags: cloud

jira-cloud