Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Subquery syntax when using Scripted JQL funtion subtasksof("")

Dan Deftos
Contributor
July 28, 2014

I am trying to use this JQL function with a subquery contain an AND statement. Essentially searching for issues in multiple projects with a particular component. It does not seem to allow for multiple selections in the subquery. I am using the following:

project = X AND component = "Y" AND issueFunction in subtasksOf("project = X AND component = Y"). I have tried multiple methods of wrapping the subquery in parens and quotes. Is it possible to do this and I just have the syntax incorrect? Also I am assuming we cannot pass in the name of a filter here but have to enumerate the entire query we are attempting to make.

2 answers

1 accepted

0 votes
Answer accepted
JamieA
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.
July 28, 2014

that should work fine... in what way is there a problem?

You can use "filter = " - check the JQL docn.

> cannot pass in the name of a filter here but have to enumerate the entire query we are attempting to make

You don't have to duplicate the clauses - it depends what you want. In your case having project = X on the outer query is redundant, as subtasks can't be in different projects. They can have different components from the parent, so like I say, it depedns what you are trying to do.

JamieA
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.
July 29, 2014
Dan Deftos
Contributor
July 30, 2014

I understand now what my original problem was. It was related to the fact that the specific component I was looking for was not a single word but multiple words (ex First Second). I gleaned that I needed to us the ' around this which worked perfectly. In addition I now know how to use a filer within this JQL function. Thank you very much for your responses. They helped immensely.

1 vote
Jose Carlos Cedillo Marquez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 8, 2019 edited

Im trying to use 

issue in hqlLinkedIssuesOf("project = Roundup AND issuetype = "JIRA WR" AND "Project Name" = Lab-Ongoing-Tests AND createdDate >= startOfYear(-2) ", "", "")

And I JIRA send me this error

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

Could you help with the SUBQUERY

Thanks

Matthew Davison July 25, 2019 edited

you have to put a \ character before a quote when nested inside a function.

ex.

issuefunction in linkedissuesof("issuetype = \"JIRA WR\"")

Like Maysarah Abu-Laban likes this

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events