Try it Free!

 

Using Java to extract data from Jira

Welcome to our series on writing a Java app to extract data from the Jira APIs!


Link to Java episode 1

Episode 1: The environment

In this episode, we describe what we are doing (our requirements) and how our environment looks (i.e., network, Jira Server, and development computer).


Link to Java episode 2

Episode 2: The bare bones

In this episode, we set up the skeleton of our program - creating classes and stubbed-out functions to represent each of our requirements. Then, we wire together all the pieces and give it a test run to make sure we're on the right track.


Link to Java episode 3

Episode 3: Login to Jira via Script

In this episode, we tackle our first requirement by writing the function which automatically logs into Jira for us and receives back a response containing the JSESSIONID that we will use to authenticate the rest of our requests.


Link to Java episode 4

Episode 4: Let's add some error handling

Now that we have an app that does something, we are ready to see its output (or errors). So in this episode, we add simple error handling and debug output.


Link to Java episode 5

Episode 5: Parsing the JSESSIONID

Now that we can see the response, we can code the function that parses out the JSESSIONID and saves it for use in authenticating our calls to the other Jira APIs.


Link to Java episode 6

Episode 6: Use the JSESSIONID to request data from Jira APIs

This episode is the climax! We use our JSESSIONID to call a few Jira APIs and review what they send back to us. We'll try:

  1. Getting information about a user (api/2/user),
  2. Listing projects assigned to a user (api/2/issue/picker), and
  3. Retrieving issues, comments, and worklogs using the IonaFX Business Intelligence Export plugin's API.


Link to Java episode 7

Episode 7: Parse JSON into CSV format

With our results in hand, we translate them into a format that can be read by almost any spreadsheet, BI tool, reporting system, or even humans!


Link to Java episode 8

Episode 8: Write to file

In this last episode, we simply drop our CSV-formatted data into a file, so it can be made available to other users or tools.