JIRA 4.0 : Remote API (SOAP) Examples
This page last changed on Oct 26, 2006 by yuenchi.lian.
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 Groupgroup = 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!']}]) |
![]() |
Document generated by Confluence on Oct 06, 2009 00:31 |