Scriptrunner JQL functions seem to not work

JIRA gives me an error when I try to run this query:

project = BNM AND issuetype in (Bug, "User Story", "Technical task", "User Story Bug") AND subtasksOf(((status != Backlog AND Type = "User Story") OR type != "User Story"))

 

The error is as follows:

Error in the JQL Query: Expecting operator but got '('. The valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN', 'IS' and 'IS NOT'. (line 1, character 102)

 

We're running a downloadable JIRA (v6.1.6).  I've checked the add-ons page in the admin console and it indicates that Scriptrunner v2.1.16 is installed, 1 module is disabled: 

Resource to add View in Navigator to sprints on the rapid board (ghShowInNavigator)
What am I missing to get this to work?

1 answer

1 accepted

4 votes
Accepted answer

Hey Johan.

  • subtasksOf is used in combination with helper function issueFunction.
  • You forgot quotes inside subtasksOf 

So it should look something like this 

project = BNM AND issuetype in (Bug, "User Story", "Technical task", "User Story Bug") AND issueFunction in subtasksOf('((status != Backlog AND Type = "User Story") OR type != "User Story")')

 

 

 

Thank you Andrey! This works perfectly now. I wish the documentation for scriptrunner would make this clear too, but at least now the answer is on here.

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,370 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