Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA ISSUE CREATION USING JRJC API

Deleted user August 27, 2013

Can we create jira issues using JRJC API ? If yes, how do we create it?

Thanks

3 answers

1 accepted

1 vote
Answer accepted
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2013

you can try with this code

/populate issue fields
com.atlassian.jira.rest.client.domain.input.IssueInputBuilder issueBuilder = new IssueInputBuilder("ProjectKey", "IssueType");
issueBuilder.setDescription("issue description");
issueBuilder.setSummary("issue summary");

//create the client
BasicHttpAuthenticationHandler myAuthenticationHandler = new BasicHttpAuthenticationHandler("jira.username", "jira.password");
JerseyJiraRestClientFactory factory = new JerseyJiraRestClientFactory();
URI jiraServerUri = new URI("http//jira.yourdomain.com");
JiraRestClient restClient = factory.create(jiraServerUri, myAuthenticationHandler);

//create the issue
NullProgressMonitor pm = new NullProgressMonitor();
com.atlassian.jira.rest.client.domain.input.IssueInput issueInput = issueBuilder.build();
BasicIssue bIssue = restClient.getIssueClient().createIssue(issueInput, pm);

//get the newly created issue
com.atlassian.jira.rest.client.domain.Issue jIssue = restClient.getIssueClient().getIssue(bIssue.getKey(), pm);

check this for your refernce

https://ecosystem.atlassian.net/wiki/display/JRJC/Tutorial

another sample code can get here

https://bitbucket.org/atlassian/jira-rest-java-client/src/75a64c9d81aad7d8bd9beb11e098148407b13cae/test/src/test/java/samples/ExampleCreateIssuesAsynchronous.java?at=master

Deleted user August 28, 2013

Thankyou very much Prasad. I have seen this code earlier,i'm using this in my maven project but unable to get NullProgressMonitor class, my version is j-r-j-c 2.0.0-m2 . Can you please provide me pom.xml ?

Thanks

RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 28, 2013
0 votes
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 18, 2013

i got mail syaing this question has answered but here it not showing :(

0 votes
Deleted user September 12, 2013

Thanks prasad done with my task i have seen jrjc tutorial (second one).

RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 12, 2013

don't forget to accept as answer if something helped here so other people can choose right answer!!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events