PerlLogging In#!/usr/bin/perl use SOAP::Lite; use Data::Dumper; my $soap = SOAP::Lite->proxy("http://localhost:8090/rpc/soap/jirasoapservice-v2?wsdl"); my $auth = $soap->login("admin", "admin"); Creating Issue
$issueMap = {"project" => SOAP::Data->type(string => "YQ"),
"components" => [{"id" => SOAP::Data->type(string => "10010")}],
# this is definitely not working as "10010" will be 'autotyped' to int:
# "components" => [{"id" => "10010"}],
"type" => SOAP::Data->type(string => "1"),
"summary" => SOAP::Data->type(string => "Issue created via Perl/SOAP")
};
my $issue = $soap->createIssue($auth->result(), $issueMap);
PythonLogging In#!/usr/bin/python import SOAPpy, getpass, datetime, array, base64, random from SOAPpy import Types soap = SOAPpy.WSDL.Proxy('http://localhost:8090/rpc/soap/jirasoapservice-v2?wsdl') jirauser='admin' passwd='admin' auth = soap.login(jirauser, passwd) Adding User to Group
group = soap.getGroup(auth, 'foo')
user = soap.getUser(auth, 'admin')
user = {'name': user['name']} # without this line, you might be facing some funny problems. see JRA-7920.
soap.addUserToGroup(auth, group, user)
Listing Workflow Actions and associated Fields and Progressing# List actions = soap.getAvailableActions(auth, 'MYC-28') print "actions:" for action in actions: print action fields = soap.getFieldsForAction(auth, 'MYC-28', action['id']) for field in fields: print field; print "-----" # Progress issue = soap.progressWorkflowAction(auth, 'MYC-28', '5', [{'id': 'resolution', 'values': ['2']}, {'id': 'assignee', 'values': ['admin']}, {'id': 'comment', 'values': ['testo!']}]) |
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 2.5 Australia License.

Comments (8)
Dec 04, 2008
Tom Wilberding says:
Here is a C# example: Stub code, or skeleton code, is a method of generating se...Here is a C# example:
Stub code, or skeleton code, is a method of generating server class files based off a web service defintion file (WSDL). Most programming languages have SOAP tools designed to generate stub code from a WSDL file.
Visual Studio .NET installs with an application called wsdl.exe which can be used to generate server stub code as well as client code to interact with that service. This file is usually located under the .NET SDK bin directory for example:
The wsdl file supports converting a WSDL file into a .NET language stub/client code. There is a /language argument that can be used to specify the .NET language to generate the stub code file in. The default language is C#. Here are some examples commands using the WSDL file from our local JIRA installation.
This will generate a class called JiraSoapServiceService.cs that can be used to remotely access JIRA via C#.
This class has quite a few methods (see class diagram below or javadocs above). Most can be called synchronously or asynchronously with an event handler.
Here is a simple example program that uses the stub/client code to create a new issue in our JIRA server
May 04
Anonymous says:
hi Tom Wilberding Your Example is very help full for beginaers...with the help ...hi Tom Wilberding
Your Example is very help full for beginaers...with the help of this i get start working with JIRA API'S..but i m trying to do some more thing in C# like i want to show the list of all assignees in Dropdown list and want ot get the values of Custom field in Dropdown list attaching a single/multiple file into the issue.....
any help will be appreciable pls help ...
Thanks & Regards
Rupesh Prasad
May 07
Rosie Jameson [Atlassian Technical Writer] says:
Hi Rupesh, Could I suggest that you please try posting your question in the Dev...Hi Rupesh,
Could I suggest that you please try posting your question in the Developers Forum? http://forums.atlassian.com/forum.jspa?forumID=100
Many thanks,
Rosie
Jun 08
Anonymous says:
Hi Tom, Thanks for the creation example. Can you please give an example of upd...Hi Tom,
Thanks for the creation example.
Can you please give an example of updating an issue? I'm facing problems setting the value of RemoteFieldValue with C#.
Thanks in advance,
Jaspreet
Jun 08
Bob Swift says:
You can look at the source for JIRA Command Line Interface.You can look at the source for JIRA Command Line Interface.
Jun 16
Anonymous says:
How do I have an operation to add a value for a customfield? I have s...How do I have an operation to add a value for a customfield? I have searched through the WSDL API's but have not found any which does that.
-Mahesh
Jun 16
Bob Swift says:
See my comment above.See my comment above.
Jun 16
Timothy Chin says:
You can check out the parent page: http://confluence.atlassian.com/display/JIRA...You can check out the parent page:
http://confluence.atlassian.com/display/JIRA/Creating+a+SOAP+Client
It has an example which you can use.
Add Comment