Created
May 13, 2011 20:01
-
-
Save xn/971216 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
gem 'soap4r' # The soap4r gem is actually an updated version of the built-in SOAP driver, so we need to override it. | |
require 'soap/wsdlDriver' | |
soap = SOAP::WSDLDriverFactory.new('http://localhost:8080/rpc/soap/jirasoapservice-v2?wsdl').create_rpc_driver | |
# Login. | |
token = soap.login('admin', 'admin') | |
# Create an issue. | |
issue_map = { | |
:type => "1", | |
:project => "TEST", | |
:summary => "Created with soap4r", | |
:description => "This is the description.", | |
:assignee => "admin" | |
}; | |
issue = soap.createIssue(token, issue_map); | |
# Close the issue with a resolution of "Fixed". | |
action = "2" # 2 = "Close". Note how this is actually a string, not an integer. | |
resolution_type = "1" # 1 = "Fixed". Also a string. | |
issue = soap.progressWorkflowAction(token, issue.key, action, [{ :id => "resolution", :values => resolution_type }]) | |
search_string = "" | |
offset = 0 | |
max = 100 | |
issues = soap.getIssuesFromTextSearchWithLimit(token,search_string, offset, max) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment