Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner JQL functions seem to not work

Johan Pretorius July 20, 2015

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
Answer accepted
Andrey Kuzmin
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.
July 20, 2015

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

 

 

 

Johan Pretorius July 23, 2015

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
TAGS
AUG Leaders

Atlassian Community Events