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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Apr 10, 2018 in Marketplace Apps

Learn about how Stefan K. built one of the *first ever* Marketplace apps

In this post you will discover more about the evolution of K15t software, some big topics they're currently focusing on in the app space, and a rare (not not funny!) photo of founders Mike Cannon-Bro...

12,809 views 11 24
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