I would like to use Unirest Java libraries for accessing Jira Cloud. Can you share any code snippets? Thank you.
Asked
Active
Viewed 840 times
1 Answers
1
First add the Unirest dependency to your pom.xml (for Maven):
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
</dependency>
Then use the following syntax to query JIRA Cloud. Replace yourjira with your instance name and replace with your username and password.
HttpResponse<JsonNode> response = Unirest.get("https://yourjira.atlassian.net/rest/api/2/search?jql=").basicAuth("username","password").asJson();
System.out.println(response.getBody());
More specific JIRA Cloud REST API syntax can be found here: https://docs.atlassian.com/jira/REST/cloud/

hubpixel
- 319
- 1
- 10
-
Its working precisely. Thank you so much, it is much simpler than the Jersey client. – Srikrishna Pothukuchi Apr 21 '17 at 03:21