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

How to authenticate to Jira REST API and retrieving JSON data

I've been attempting for days on how to authenticate using login credentials and trying to retrieve specific JSON data for transitions in Jira. Can someone please help me with this one? If anyone can give me any pointers on what library is easiest to use and how I can I easily parse the JSON. Thanks!!!

String username = "username";
String password = "password";

Authenticator userAuthenticator = new Authenticator(username, password);
String client = ClientBuilder.newClient()
.target("http://jira.corp.local:8080")
.register(HttpAuthenticationFeature.universalBuilder()
.credentialsForDigest(username, password)
.build())
.path("/rest/api/latest/issue/ORI-5714/transitions?expand=transitions.fields")
.request(MediaType.APPLICATION_JSON)
.get(String.class);

System.out.println(client);

 

1 answer

0 votes
Warren Community Leader Sep 11, 2019

Hi @Joshua Azicate 

First question to ask is whether this is a cloud or server version of Jira - the answer to this will decide how to proceed.

Using the server version of Jira

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

231 views 1 2
Join discussion

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