Hello guys and girls,
can anybody post a valid Maven pom.xml along with simple Java code example for JRJC usage.
It should use JerseyJiraRestClientFactory or AsynchronousJiraRestClientFactory for example creating issues on remote JIRA instance and retrieving JIRA Issue object
I've written an example usage of the JRJC (version 2.0.0-m2) as a standalone, executable JAR.
Here's the pom.xml.
And the main Java class.
I tested it against JIRA 6.0.
Thank you very much Joseph. I'll give it a try.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great - it finaly works! I've tested it against JIRA v5.2.5 successfully. One more question Joseph, I had an error when tried to buld it on mu plugin development environment which uses Maven v2.1 for project build. Is there any chance that I could use JRJC you sent like this in Jira plugin?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, forget about last question cause I just saw plugin that you have over there in Bitbucket repository and it works like charm. Only thing that I was interested about is that Maven pom of yours. I never saw that kind of exclusions in pom in order not to have dependency issue between them. So it must of bean that, that I always had problems with Maven build of given pom files until now, cause I didn't know what to exclude cause JIRA already have some of them included. Anyway thanks a lot, you saved me lot of trouble.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
too many dependency issues - checksum issues and not downloading other dependencies properly. Writing my own instead...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have spent endless hours looking for a simple example ... all the API examples I found..until now...were too old and API's no longer worked.
+1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is the example I provided OK? If not, please let me know which aspects of it you find are most in need of improvement. :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The project that I shared should work.
https://code.google.com/p/ramp-sample/source/browse/samples/jira-rest-java-client/pom.xml
Let me know if this doesn't work for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Joe Clark [Atlassian]: I did everything like in the example, but however... I'm getting an error :( do you happen to know why am I getting this? when the program get to this line JiraRestClient client = factory.createWithBasicHttpAuthentication(uri, username, password); Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/http/nio/NHttpMessageParserFactory I can't help to think this is happening because of maven dependencies. Any suggestion?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thnx Joseph! Was struggling to get the JIRA Rest client working but your example really helped! Much obliged!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actuall i am not using JRJC, we are using our won client using jersy, you can try if you want
package com.rest.client; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; public class RESTclient { public static void main(String[] args) { try { Client client = Client.create(); client.addFilter(new HTTPBasicAuthFilter("username", "password")); WebResource webResource = client.resource("http://localhosr:8080/rest/api/2/issue"); String input="{\"fields\":{\"project\":{\"key\":\"JIRA\"},\"summary\":\"Test Ticket\",\"description\":\"This is a test CR\", \"reporter\": {\"name\": \"prasad\"},\"issuetype\":{\"name\":\"Defect\"},\"versions\":[{\"name\":\"1.0\"}],\"customfield_10692\":{\"value\":\"Stability\"},\"customfield_10430\":{\"value\":\"Stability\"},\"customfield_10005\":{\"value\":\"Blocker\"},\"components\":[{\"name\":\"TEST\"}]}}"; ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input); String output = response.getEntity(String.class); System.out.println("Output from Server .... \n"); System.out.println(output); } catch (Exception e) { e.printStackTrace(); } } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, I already use my own Rest client, I was just wondering if some one really use JRJC and have pom.xml and code snippet for eg. AsynchronousJiraRestClientFactory usage (JRJC v2.0.0-m23)
having all this posts and tutorials and not one really working example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
check the this post
https://answers.atlassian.com/questions/192961/jira-rest-client-proper-usage
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is not a solution. I see that changing the dependency scope to compile fixed initial problem but the code eventually didn't work cause of another dependency issue with apache httpclient. So I am asking if anybody have working pom.xml with code snippet of using RJRC?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.