Forums

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

Call JIRA Create Ticket API via .NET

Vinod Arya September 26, 2011

Team

We want to call JIRA Create API from our Application to be developed in .NET, can you please provide steps to achieve this functionality.

Thanks

Vinod Arya

3 answers

0 votes
Vinod Arya October 17, 2011

1. Add service reference in Application. The service URL is http://Your JIRA URL/rpc/soap/jirasoapservice-v2?wsdl.

This service is present in each JIRA install. For local system install JIRA, service URL is http://localhost:8080/rpc/soap/jirasoapservice-v2?wsdl.

2. Create object for JiraSoapServiceClient as jiraSoap. This class having all API function like createIssue,login,logout.

For ex

JiraSoapServiceClient jiraSoap = new JiraSoapServiceClient()

3. Using JiraSoapServiceClient object login to our JIRA Application. For login to application login function is present. This function takes two string parameter as “Userid” and “ password” and return a string it userid and password is correct.

Syntax

String= login(String s1, String s2)

For ex

string token = jiraSoap.login("rpetkar", "amex123").

4. Create a object for RemoteIssue as newIssue. Using this class we can set and get all issues attributes.

For ex

RemoteIssue newIssue = new RemoteIssue()

5. Using RemoteIssue object newIssue set all fields value which we want to in new created issue.

For ex

newIssue.assignee = "rpetkar";

newIssue.summary = "Test Issue for API";

newIssue.description = "This is a test issue automatically created via the SOAP web services.";

newIssue.project = "CS";

newIssue.type = "3";

newIssue.priority = "3";

To set customfields values we need to use some othe functions and classes.


6. For customfields first return all customfields with it’s database id in one array. For this use getCustomFields function of JiraSoapServiceClient.

Syntax

RemoteField[] = jiraSoap.getCustomFields(string s1); Using this function we get all customefields ids.

For ex. if (fields[i].name == "Product")

{

productFieldId = fields[i].id;

}

7. Using this customfields id we set value to each customfields. To set the customfields values use RemoteCustomFieldValue class and it’s attribute id and values.

8. After setting this all parameter call createIssue function of JiraSoapServiceClient class. This function creates issue in jira application and return created issue information. It takes two parameter first is login credinetial and second is RemoteIssue class object i.e newIssue.

Syntax

RemoteIssue = createIssue(String token, RemoteIssue newIssue).

For ex. RemoteIssue createdIssue = jiraSoap.createIssue(token, newIssue)

9. The issue with Summary "Test Issue for API" is created in JIRA application.

0 votes
Nic Brough -Adaptavist-
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 27, 2011

For more options, see https://developer.atlassian.com/display/JIRADEV/JIRA+Developer+Documentation (Bob's CLI uses the methods under "remote API reference" in there, and it uses them well, but it might not be the best way for you to do it. Depends on your external program)

Vinod Arya September 28, 2011

Bob/Nic

Thanks for the response, I am novice in using JIRA API. Will appreciate, if you can please provide step-by-step guide how to use JIRA API from a new .NET Application

Bob Swift
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.
October 3, 2011

Java and .NET frameworks have the ability to run a OS command. That is what you need to run a JCLI command. The referenced page has examples to create an issue. Install the JCLI, follow the example command, and consult your .NET references for running an OS command.

0 votes
Bob Swift
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 26, 2011

JIRA Command Line Interface createIssue action.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events