Forums

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

Filters not working when passing through java code

Gaurav Jain June 26, 2019

I am trying to fetch data using a filter : 

"Defect Created in Integrity" is EMPTY AND status= "TO DO"

Through postman I am able to get the data but with java code it is not working .

I am getting the following exception  :

java.io.IOException: Server returned HTTP response code: 400 for URL: https://gauravj7.atlassian.net/rest/api/3/search?jql="Defect Created in Integrity" is EMPTY AND status= "TO DO"
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at Jira2.main(Jira2.java:23)

Can someone help me with this ?

1 answer

0 votes
Nic Brough -Adaptavist-
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.
June 26, 2019

That's because the url you are giving it is invalid - it has unencoded spaces in it.  You'll need to encode the url.

You say "in java" though - are you writing an app inside Jira?  If so, instead of using clumsy urls, you could use the API directly to build a valid query without needing to think of urls.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events