Can't figure out what is wrong with this JQL

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

You need to wrap it into ''.

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"')

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"')

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

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.

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).

;-). 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...

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

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

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()

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

You should definitely upgrade the plugin...

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

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.

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
Community showcase
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,355 views 0 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you