Can we create jira issues using JRJC API ? If yes, how do we create it?
Thanks
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 ?
are you looking for this?
https://bitbucket.org/atlassian/jira-rest-java-client/src/2f8cf32edafd6efd127accb8b14cd9ddfa9343ab/pom.xml?at=rest_api_guard
or this?
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!!
i got mail syaing this question has answered but here it not showing
It looks like you're new here. Sign in or register to get started.