Forums

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

Need Help with JQL Query!!

Tejaswi Gangurde
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 30, 2018

Hello There!!

I am trying to get list of issues filtered by issue type by making rest api call. uri works for me on postman is https://jira.comapnyname.net/rest/api/latest/search?jql=issuetype=outage AND (createdDate>=startOfMonth(-1) AND createdDate<startOfMonth()).

When I try to pass the same url through api call, it says illegal character. I tried replacing the spaces with %20 as '

"search?jql=issuetype=outage%20AND%20(createdDate>=startOfMonth(-1)%20AND%20createdDate<startOfMonth())"

but still same issue. Please do let me know how can I pass jql query through restapi call.

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Thomas Deiler
Community Champion
January 30, 2018

Dear @Tejaswi Gangurde,

in Java I use this function for URL encoding to UTF-8:

protected String encodeMsg(String message) {
try {
return URLEncoder.encode(message,"UTF-8");
} catch (UnsupportedEncodingException e) {
String msg = "UnsupportedOperationException: " + e.getMessage();
logger.error(msg);
throw new RuntimeException(msg);
}
}

'message' is the JQL.

Hope that helps ...

So long

Thomas

Tejaswi Gangurde
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 30, 2018

Thanks @Thomas Deiler

It works!! 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events