Writing a Java client for the REST API
In this recipe, we will quickly see how we can create a Java client to communicate with JIRA using the REST APIs.
Getting ready
Make sure that the Accept remote API Calls option is turned ON in JIRA under Administration | System | General Configuration.
How to do it...
In order to connect to JIRA using REST APIs, Atlassian has developed a JIRA REST Java client library called JRJC in short. It provides a thin layer of abstraction on top of the REST API and related HTTP(S) communication, and gives a domain object model to represent JIRA entities, such as issues, priorities, resolutions, statuses, users, and so on. The REST API and the JRJC library are quickly evolving, with new methods added in every version! The status of the library can be viewed at https://ecosystem.atlassian.net/wiki/display/JRJC/Home.
We will be using JRJC to connect to our JIRA instance using the standalone Java program. We can do this by carrying out the following steps:
Create a Maven...