ERROR: Unable to find JQL function while trying to execute a REST API Edited

I'm trying to run following rest API using Jersey java reset client.

https://issues-alpha.net/rest/api/2/search?startAt=0&maxResults=1&jql=component=43658+AND+status+in+(Open)&fields=components,issuetype

I have tested above REST url using postman and I"m getting a valid response but I'm not able to make it work with Jersey rest java client.

Here is the snippet of the code I'm using to build the Webtarget.

 

WebTarget webTarget = jiraClient.getClient().path("search")
.queryParam("startAt", 0)
.queryParam("maxResults", 1)
.queryParam("fields", "components,issuetype")
.queryParam("jql", "component%3D43658\\u002BAND\\u002Bstatus\\u002Bin\\u002B(Open)");

Error I'm getting: 

 "map" : {
"errorMessages" : {
"myArrayList" : [ "Unable to find JQL function '43658+AND+status+in+(Open)'." ]
},
"errors" : {
"map" : { }
}
}
}

 

 

 

 

1 answer

1 accepted

When you are using jersey client then do not add + to specify the spaces. Just use the normal jql query.

Solution which worked:

 

WebTarget webTarget = jiraClient.getClient().path("search")
.queryParam("startAt", 0)
.queryParam("maxResults", 1)
.queryParam("fields", "components,issuetype")
.queryParam("jql", "component=43658 AND status in (Open)");

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 Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

1,016 views 3 12
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