JIRA ISSUE CREATION USING JRJC API

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

Thanks

3 answers

1 accepted

This widget could not be displayed.

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

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

This widget could not be displayed.

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

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

This widget could not be displayed.

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

79 views 0 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you