It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

unable to invoke Cloud Rest Call For Issue Search Edited

I am Trying this 

/rest/api/3/search

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. Here Is my Code Sample- 

@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);
System.out.println("after Url---------------");
RestTemplate restTemplate = atlassianHostRestClients.authenticatedAsAddon();
ResponseEntity<String> responseEntity = restTemplate.getForEntity(builder.toUriString(), String.class);
atlassianHostRestClients.authenticatedAsAddon().getForObject(builder.toUriString(), String.class);
String responsetemp = responseEntity.getBody();
System.out.println("responsetemp--------------" + responsetemp);
return ResponseEntity.ok(responsetemp);

}

I tried another rest Calls also that are working But only this is not working.

It is giving this exception--

org.springframework.web.client.HttpClientErrorException: 400

Any Suggestion for Solving this Problem.

Thanks.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you