Forums

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

Need assistance with a ScriptRunner query

Gregory Kremer
Contributor
October 25, 2022

Hi everybody,

I have a very "strange" case that I need your help with. I have a simple JQL query that I run. It look like this:

Project = "Program Dev" AND "Team[Team]" in (29, 41, 14, 23, 25, 35, 39, 40) AND issuetype in (Epic, "User Story") and status in ("In Progress", "In Review") and "Acceptance Criteria[Paragraph]" is EMPTY

It runs perfectly fine and brings back 2 records.

I needed to expand it a bit to add issues where "Acceptance Criteria" is < than 10 char.  Obviously, it needs to run in the ScriptRunner. So here is what I have:

Project = "Program Dev" AND "Team[Team]" in (29, 41, 14, 23, 25, 35, 39, 40) AND issuetype in (Epic, "User Story") AND status in ("In Progress", "In Review") AND ("Acceptance Criteria" is EMPTY OR issueFunction in issueFieldMatch("project = DEV", "customfield_12100", "^.{0,10}$"))

It runs, but brings no records back, and I know that at least 2 records should be there. So my question to all of you guys... What am I doing wrong here? I would greatly appreciate your assistance.

 

 

1 answer

0 votes
Trudy Claspill
Community Champion
October 25, 2022

At a glance the syntax looks correct.

In the first example I notice that it says "Acceptance Criteria[Paragraph]" and in the second it says just "Acceptance Criteria"? Why is that different?

Are you sure that the custom field id is correct for Acceptance Criteria?

Do you get any results if you remove the portion for ...?

"Acceptance Criteria" is EMPTY 

Asking that to confirm that you actually have issues with only 1..10 chars in the Acceptance Criteria field that match all the other criteria.

Gregory Kremer
Contributor
October 27, 2022

Thank you Trudy for your reply. I've tried this query with many variations, with 2 different results:

1. No records returned, when expected 2.

2. Error message:

Search parsing timed out. You probably have a subquery that returns too many issues.

 The latest one

Project="Program Dev" And "Team[Team]" in (29, 41, 14, 23, 25, 35, 39, 40) AND issuetype in (Epic, "User Story") AND status in ("In Progress", "In Review") AND (“Acceptance Criteria[Paragraph]" is Empty OR issueFunction in issueFieldMatch("project = DEV", "customfield_12100", "^.{0,10}$"))

Came back with the error above. Not sure if I should open a case with tech support.

Thank you again for your time.

Trudy Claspill
Community Champion
December 29, 2022

Hello @Gregory Kremer 

Did you ever find the solution for this?

Gregory Kremer
Contributor
January 3, 2023

@Trudy Claspill Happy New Year Trudy. Sorry for the delay in my reply, as I took some time off. To answer your question... As you mentioned above, the syntax of the query was correct. The problem was, that it took more than allotted 30 sec to retrieve the data, thus the query simply bombed out. It is very unfortunate but, as I understand, anything that takes more than 30 sec in Cloud version of JIRA wouldn't work, even such a thing as retrieving application configuration. For example, I often need to change configuration in "Zendesk Support for JIRA" add-on. I can't do it during the busy hours, because retrieving configuration itself takes longer than 30 sec - my request just comes back with "Something's gone wrong" error. I hope that answers your question.

Trudy Claspill
Community Champion
January 3, 2023

I'm glad you found the root cause of the error. Thank you for sharing that information.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events