This page last changed on Oct 26, 2006 by yuenchi.lian.
More code examples can be found in the SVN repository. You may also try looking for them in the jira-user and jira-developer mailing list (or forum).

Perl

Logging 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);

Python

Logging 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!']}])
Document generated by Confluence on Oct 06, 2009 00:31