Can't figure out what is wrong with this JQL

Mason Foley May 8, 2015

I’m trying to execute the following but it keeps complaining with “Error in the JQL Query:  Expecting ‘)’ or ‘,’ but got ‘in’. (line 1, character 27)”

 

Here is the query:

 

issueFunction in subtasksOf(project in (BAT, Shields, EDD, PRS, "Clear 3.0", CAiT, "Real Time Monitoring") AND issueType = "Story" AND summary ~"FITNESSE")

 

The sub-query works and all I’m attempting to do is wrap it with the issueFunction in subtasksOf() function.  Which the documentation suggests here:  https://goo.gl/K9e4Bo

 

Anyone have any suggestions or thoughts how I should get the sub-tasks I’m looking to get?

2 answers

2 votes
Jozef Kotlár
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.
May 8, 2015

You need to wrap it into ''.

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.
May 8, 2015

Yep, to be exact: issueFunction in subtasksOf('project in (BAT, Shields, EDD, PRS, "Clear 3.0", CAiT, "Real Time Monitoring") AND issueType = "Story" AND summary ~"FITNESSE"')

Mason Foley May 8, 2015

Is that a double quote? Two single quotes? And what exactly is wrapped? The sub-query? If so, the syntax checker goes green but I get this error: Unable to find JQL function 'subtasksOf(project in (BAT, Shields, EDD, PRS, "Clear 3.0", CAiT, "Real Time Monitoring") AND issueType = "Story" AND summary ~"FITNESSE")'. This is the attempted query: issueFunction in subtasksOf('project in (BAT, Shields, EDD, PRS, "Clear 3.0", CAiT, "Real Time Monitoring") AND issueType = "Story" AND summary ~"FITNESSE"')

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.
May 8, 2015

the error that you paste and the attempted query point to two different things. Can you paste in what I put.

Mason Foley May 8, 2015

If you look at where I said "attempted query", it's the same as what you provided in your reply. The error message isn't echoing the actual query itself.

Jozef Kotlár
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.
May 10, 2015

Thanks, Jamie - I cannot recall why I was so terse - probably dis-functional copy-paste. Mason - yes, the subtasksOf() accepts single argument, so you need wrap subquery into quotes (single or double).

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.
May 10, 2015

;-). Mason - if it's still not working you can save your inner query as say MyFilter, then use subtasksOf(filter = MyFilter) This can let you avoid quoting issues...

Mason Foley May 11, 2015

Unfortunately, saving as a filter and then wrapping the filter name results in the following: http://screencast.com/t/HDiuqYu7o

Mason Foley May 11, 2015

When I don't wrap the filter= sub-query in quotes (as you have in your reply), I get the following: http://screencast.com/t/7WDJKl3b9

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.
May 11, 2015

I have no idea what is going on there. What jira and plugin version? Does any function provided by the plugin work, eg issueFunction in hasSubtasks()

Mason Foley May 11, 2015

Version: 2.1.17 Vendor: Jamie Echlin Ltd Add-on key: com.onresolve.jira.groovy.groovyrunner JIRA v6.3.9

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.
May 11, 2015

You should definitely upgrade the plugin...

Mason Foley May 12, 2015

You're confident the upgrade will provide a successful result?

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.
May 12, 2015

Nope, because you shouldn't be getting the error that you appear to be. But I'm confident that you are not on the best version of the plugin for your version of jira, and moreover it's not even marked as compatible.

0 votes
Mason Foley May 18, 2015

This query does not work in version 2.1.17.  Upgraded to 3.0.16 and the query works.  Apparently there is logic to escape quotes for the user automatically.  After inputting the following:

issueFunction in subtasksOf('project in (BAT, Shields, EDD, PRS, "Clear 3.0", CAiT, "Real Time Monitoring") AND issueType = "Story" AND summary ~"FITNESSE"')

The query executed and was re-rendered as:

issueFunction in subtasksOf("project in (BAT, Shields, EDD, PRS, \"Clear 3.0\", CAiT, \"Real Time Monitoring\") AND issueType = \"Story\" AND summary ~\"FITNESSE\"") ORDER BY key DESC, updated DESC

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events