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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

849 views 2 9
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