Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Jira Java REST Client


Please tell me that I am not the only one who has had problems getting the JRJC working? I have tried so many different tutorials/examples and for the life of me cannot get any to work! sad  I keep getting dependency errors even when I have the jar in pom.xml or else I'm getting errors because the REST client is not the right type of REST client.


At the moment I am getting a "NoClassDefFoundError" for "org/apache/http/conn/HttpRoutePlanner" and from looking it up this seems to come from httpclient jar which I have downloaded and in my pom.xml.


I need it for updating issues but at this stage if I got a small simple working example of it doing anything I'd be happy! Does anyone have a small simple working example that I could try? Desperate at this stage!




2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

I am new to all of this, and tried the JRJC client, and YES you are not the only one having trouble making it work.

I almost made my decision not to use it, but it still a goog point to start interfacing JIRA through its REST API.

So, i tried and i succeeded to get it work with a simple code : 

package com.atlassian.jira.examples;
import com.atlassian.util.concurrent.Promise;

 * Entry-point invoked when the jar is executed.
public class Main
    private static final String JIRA_URL = "http://localhost:8082";
    private static final String JIRA_ADMIN_USERNAME = "toto";
    private static final String JIRA_ADMIN_PASSWORD = "toto";
    public static void main(String[] args) throws Exception
        // Construct the JRJC client
        System.out.println(String.format("Logging in to %s with username '%s' and password '%s'", JIRA_URL, JIRA_ADMIN_USERNAME, JIRA_ADMIN_PASSWORD));
        JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
        URI uri = new URI(JIRA_URL);
        JiraRestClient client = factory.createWithBasicHttpAuthentication(uri, JIRA_ADMIN_USERNAME, JIRA_ADMIN_PASSWORD);
        // Invoke the JRJC Client
        Promise<User> promise = client.getUserClient().getUser("toto");
        User user = promise.claim();
        Promise<Issue> promiseIssue = client.getIssueClient().getIssue("TEST-1");
        Issue issue = promiseIssue.claim();
        // Print the result
        System.out.println(String.format("Your admin user's email address is: %s\r\n", user.getEmailAddress()));
        // Print the result
        System.out.println("some TEST-1 details " + issue.getAssignee() + "   " + issue.getSummary() + "  " + issue.getWorklogs());
        // Done
        System.out.println("Example complete. Now exiting.");

With this pom.xml (make sure that you have the com.atlassian.fugue dependency, i am using version 2.6.1)

<project xmlns="" xmlns:xsi=""
	<name>JIRA REST Java Client Example</name>
			<!-- JRJC is distributed under the Apache 2.0 license. -->

and the most important of all, that you have this repository declared in your maven settings.xml 




My advice is give up and use a straight HTTP client. JRJC doesn't support the full REST API and isn't actively supported. I like Unirest:

Thanks, will take a look at this. Was hoping to get the JRJC working but have been trying it for so long now am on the verge of giving up - will keep this open for a while in case someone managed to get a simple example working!

I have had it working, it just isn't worth the trouble!


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