jira jql query

Krk Rama Krishna February 12, 2019

unable to query like this api/rest/2/search?jql=project = PROJNAME AND fixVersion = "MARCH RELEASE" AND assignee (NAME)'

 

 

1 answer

1 accepted

0 votes
Answer accepted
Warren
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.
February 12, 2019

Hi @Krk Rama Krishna

With the little info that you've given, the only problem I see is the syntax.

assignee (NAME) should be assignee in (NAME)  or else assignee = NAME

Hope this helps

Krk Rama Krishna February 12, 2019

Hi iam using rest call essentially i need based on fixedissue and projectname and assignee i tried both the things which u mentioned but iam not getting any response

 

jql=fixVersion = "#MARCH" AND project =PROJNAME AND assignee =NAME

ERRORS:

{"errorMessages":["Error in the JQL Query: The quoted string has not been completed. (line 1, character 14)"],"errors":{}}

{"errorMessages":["Error in JQL Query: Expecting either a value, list or function before the end of the query."],"errors":{}}

Krk Rama Krishna February 12, 2019

@Warren can u please help me with this

Warren
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.
February 12, 2019

What I think you need to do is try copying everything after jql= and pasting it into the JQL filter editor within Jira, to ensure that the syntax is correct - see my example below. I think your syntax may be wrong, in terms of quotes - the editor will provide the correct quotes (if required) if you type it in manually.

Screenshot_3.jpg

Krk Rama Krishna February 12, 2019

It is showing perfect results in the editor

Warren
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.
February 12, 2019

Okay, then try the API call without passing in any JQL (I also noticed you have rest and api the wrong way around

api/rest/2/search   should be   rest/api/2/search

Does this work? If so, there is some problem with the syntax when you combine it. Try building it up bit by bit

rest/api/2/search?jql=project = PROJNAME

then

rest/api/2/search?jql=fixVersion = "#MARCH"

then

rest/api/2/search?jql=assignee =NAME

Assuming those all work, then you can start combining them.

A further question - have you ever had any results returned via the API?

Mabutho_Mncube November 5, 2019

Hi @Warren 

having the same problem trying to filter Rest API results using Jira custom field but getting the below error

"

{"errorMessages":["Error in the JQL Query: The quoted string '2019/PI ' has not been completed. (line 1, character 35)"],"errors":{}}

"

https://tools.standardbank.co.za/jira/rest/api/2/search?jql=project=ard%20and%20customfield_18625=%222019/PI%20#3%22 

 

Programme Increment = customfield_18625

Jira.png

Warren
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.
November 5, 2019

Hi @Mabutho_Mncube 

Good result for the bokke on Saturday :-)

Your issue looks like a problem with the "/" - have you escaped it correctly?

Mabutho_Mncube November 5, 2019

Hi @Warren

it's correct I believe I just copied and paste it, it does return the results on jira as you could see in my screen print above.

 

question is : it is possible to filter data using customfield??

Warren
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.
November 5, 2019

Hi @Mabutho_Mncube 

Yes it is definitely possible to filter on customfields. I've been playing around with your string and the # seems to be causing the issue. 

For your API call, you need to change these :

  • Replace customfield_18625 with "Programme Increment" as per your screenshot.
  • Escape the # character with %23.

If that doesn't work, remove the # character and change = to ~

Mabutho_Mncube November 5, 2019

thanks @Warren 

you r a hero man "Escape the # character with %23" just worked fine

Abhishek Kalamkar July 28, 2023

@Warren This below query is throwing error.  can we create dynamic filter using custom field and edit the permissions.

 

image.png

Suggest an answer

Log in or Sign up to answer