Require
Simply drop your require statement at the top of your script
require 'jira4r/jira4r'
Creating an object
Now create the jira4r object:
- 2 = the version of the WSDL interface. At present, only v2 is supported.
- "http://jira.atlassian.com" = The URL base for your JIRA installation
jira = Jira::JiraTool.new(2, "http://jira.atlassian.com")
Login
Login to the JIRA instance in question
jira.login("soaptester", "soaptester")
Once you've logged in, the jira4r package will use your authentication token on all future requests. This makes calling JIRA methods a breeze!
Get that project!
puts jira.getProject("DEMO").inspect
The Output
cannot find mapped class: Byte I, [2007-05-07T12:38:02.352106 #6724] INFO -- : Connecting driver to http://jira.atlassian.com/rpc/soap/jirasoapservice-v2 D, [2007-05-07T12:38:03.929616 #6724] DEBUG -- : Finding method getProjects #<RemoteProject:0x1425bc0 @projectUrl="http://jira.atlassian.com", @issueSecurityScheme=nil, @id="10820", @description="A project for demonstrating JIRA's features", @permissionScheme=#<RemotePermissionScheme:0x1425184 @id=10220, @description="Copy of the default perm scheme, but where anonymous people can create issues (for the 3.0-preview 'file bug' link).", @type="permission", @permissionMappings=[], @name="Demo Permission Scheme">, @key="DEMO", @notificationScheme=nil, @url="http://jira.atlassian.com/browse/DEMO", @lead="ben@atlassian.com", @name="Demo">
The Complete Script
#!/usr/bin/env ruby require 'jira4r/jira4r' jira = Jira::JiraTool.new(2, "http://jira.atlassian.com") jira.login("soaptester", "soaptester") puts jira.getProject("DEMO").inspect
Could it get much simpler?
Labels
(None)
