Forums

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

error with quotes in field name with "issueFunction in subtasksOf "

Uwe_Speckels April 9, 2020

Hello,

who can help me with the big error? It's stupid. I have 2 queries.

The 1st one reads the parent data and then the depending sub-task. Herewith I get no error:

status = Abgeschlossen and ("Intern in PT" >= 100 or "Extern in EUR" >= 100000) AND issueFunction in parentsOf("project = PROJEKT and issuetype = Unteraufgabe and status != zu")

The 2nd one reads the sub-tasks depending on parent data with big ERROR:

issueFunction in subtasksOf("project = PROJEKT and issuetype = Projektantrag and status = Abgeschlossen and ("Intern in PT" >= 100 or "Extern in EUR" >= 100000) ") and status != zu

ERROR:
Error in the JQL Query: Expecting ')' or ',' but got 'Intern'. (line 1, character 111)

Thanks, in advance
Uwe

3 answers

3 accepted

0 votes
Answer accepted
Ste Wright
Community Champion
April 10, 2020

Hi @Uwe_Speckels 

For a few further alternatives to avoid the parsing issues:

Custom Field IDs:

Use the custom field's IDs rather than their names. Custom fields will have their ID next to the name of the field when suggesting fields in JQL like cf[12345].

So for example, if "Intern in PT" was cf[12345] and "Extern in EUR" was cf[24680] you could have:

issueFunction in subtasksOf("project = PROJEKT and issuetype = Projektantrag and status = Abgeschlossen and (cf[12345] >= 100 or cf[24680] >= 100000)") and status != zu

Saved Filter:

You can save a filter and nestle it inside another. So for example, you could save:

"Intern in PT" >= 100 or "Extern in EUR" >= 100000

...as one filter, this will give it a filter ID in the URL - eg. ?filter=13579 

You could then nestle this filter into the query - especially useful when utilising a sub-query in multiple others. To nestle it:

issueFunction in subtasksOf("project = PROJEKT and issuetype = Projektantrag and status = Abgeschlossen and filter = 13579") and status != zu

Quotation Marks:

Expanding on Jack's suggestion - quotation marks work both ways - so you could use single quotation marks for the custom fields - i.e:

issueFunction in subtasksOf("project = PROJEKT and issuetype = Projektantrag and status = Abgeschlossen and ('Intern in PT' >= 100 or 'Extern in EUR' >= 100000) ") and status != zu

So - lots of options!

Ste

0 votes
Answer accepted
Jack Nolddor _Sweet Bananas_
Atlassian Partner
April 10, 2020

Hi Uwe,

 

Please use single quotes instead:

issueFunction IN subtasksOf(' <your subquery containing double quotes> ')

 

Regards

0 votes
Answer accepted
Payne
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.
April 9, 2020

The problem is that you're embedding 2 strings that are surrounded by quotes in a larger field surrounded by quotes. When the parser hits the opening quote before Intern in PT, it has to assume that you are ending the string. So, you need to delimit those embedded quotes, like this: 

issueFunction in subtasksOf("project = PROJEKT and issuetype = Projektantrag and status = Abgeschlossen and (\"Intern in PT\" >= 100 or \"Extern in EUR\" >= 100000) ") and status != zu

Suggest an answer

Log in or Sign up to answer