Creating an issue via SOAP
In the previous recipe, we have seen how to create a SOAP client. We also saw how to use the client to connect to the JIRA instance and perform the operations, by taking 'browsing an issue' as an example. In this recipe, we will see how to create an issue using SOAP API.
Getting ready
Create a JIRA SOAP client as mentioned in the previous recipe.
How to do it...
Following are the steps to create an issue with the standard fields populated on it:
As mentioned in the previous recipe, get the JIRA SOAP service stub and log in to the box:
JiraSoapServiceServiceLocator jiraSoapServiceLocator = new JiraSoapServiceServiceLocator(); JiraSoapService jiraSoapService = jiraSoapServiceLocator.getJirasoapserviceV2(new URL(your_url)); String authToken = jiraSoapService.login(userName, password);
Create an instance of
RemoteIssue
:RemoteIssue issue = new RemoteIssue();
Populate the standard fields on the
RemoteIssue
as appropriate:issue.setProject(PROJECT_KEY); issue.setType(ISSUE_TYPE_ID...