cloud Rest call for getting data by passing JQL as Parameter. But Every time it is returning 400 status Code which means invalid JQL But I tried JQL in Jira where it is returning Correct Response. I tried Resttemplate For Client.
/rest/api/3/search
Totally agree with what @DPKJ has said above - it would be useful to see the JQL query (anonymised if required). Does the API call work for you without passing in a JQL at all? i.e does
/rest/api/3/search
work or return an error?
I am Passing Correct JQl which is working on Jira but while doing that through api that is not working.
. like this
assignee = admin
and
project =Demo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Without passing JQL it is returning response but with JQL it has error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, that's good news (sort of) because it means everything is working apart from the JQL.
I may be wrong but I think you're passing in the JQL incorrectly. It should be part of the API call, so it should look like this for your query
/rest/api/3/search?jql=assignee=admin and project=demo
whereas you seem to be passing the JQL in as a parameter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://acisplugin.atlassian.net/rest/api/3/search?jql=%20project%20%3DDemo I am Passing this URL in api call But still same problem.
I tried this also https://acisplugin.atlassian.net/rest/api/3/search?jql=assignee%3Dadmin%20and%20project%3Ddemo
But both of these URLs are working in a browser. and Giving proper response but in api it is not working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So in the browser both of these API calls work successfully, but not via code? Do you get a 400 error for both?
Have you tried using Postman to check it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I have Tried with postman also but the same status code 400. For both the same Response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you give a screenshot from Postman showing just the GET section, as below?
And then also the response from Postman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please take a look at my screenshot, because your GET line seems to have many problems :
What is in the GET box should have this format :
https://companyname.atlassian.net/rest/api/3/apicall?jql=...
where companyname is replaced with the name used in your Jira URL, apicall is replaced by a valid call as per the documentation and a valid jql statement is used
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes I have removed this / and this issueCount is just for invoking my rest call inside that where i am calling JIRA rest there i am Passing this URL https://acisplugin.atlassian.net/rest/api/3/search?jql=assignee%3Dadmin%20and%20project%3Ddemo which is working correct in both places browser and postman.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi I passed this in JQL jql=key=DEMO-1 but that becomes jql=key%253DDEMO-1
after code run. Can you help me to fix this I tried every possible way but I think because my JQL is becoming incorrect because of these changes So any help to correct this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Chakresh TiwariCan you please elaborate and share query you are trying to pass, because it seems error is in JQL you are passing or how you are passing it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi i am Using this rest api for getting IssueCount using Resttemplate. for every other api i am getting a response but for only this i am getting 400 status code.
@GetMapping("issueCount")
public ResponseEntity<String> getIssueCount(@AuthenticationPrincipal AtlassianHostUser hostUser,@RequestParam("jql") String jql) {
AtlassianHost host= hostUser.getHost();
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(host.getBaseUrl() + ConstantsInf.issueSearch)
.queryParam("jql",jql);
System.out.println("-------------- URL " + host.getBaseUrl() + ConstantsInf.issueSearch);
RestTemplate restTemplate = atlassianHostRestClients.authenticatedAsAddon();
ResponseEntity<String> responseEntity = restTemplate.getForEntity(builder.toUriString(), String.class);
atlassianHostRestClients.authenticatedAsAddon().getForObject(builder.toUriString(), String.class);
String responsetemp = responseEntity.getBody();
return ResponseEntity.ok(responsetemp);
}
I passed correct Jql still it is giving error. like this
assignee = admin
and
project =Demo
Thanks For your reply .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
without JQL it is returning response but with jql returning 400 where is my Jql Incorrect or some other problem??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.