Class: JIRA::JIRAService

Inherits:
Handsoap::Service
  • Object
show all
Includes:
RemoteAPI
Defined in:
lib/jiraSOAP/JIRAservice.rb

Overview

Interface to the JIRA endpoint server; set at initialization.

Due to limitations in Handsoap::Service, there can only be one endpoint. You can have multiple instances of that one endpoint if you would like; but if you try to set a differnt endpoint for a new instance you will end up messing up any other instances currently being used.

It is best to treat this class as a singleton. There should only be one.

HTTPS is not supported in this version.

Constant Summary

Constants included from RemoteAPI

RemoteAPI::RESPONSE_XPATH

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RemoteAPI

#create_issue_with_issue, #get_custom_fields, #get_issue_types, #get_issues_from_jql_search, #get_notification_schemes, #get_priorities, #get_project_avatar_for_key, #get_project_avatars_for_key, #get_project_with_key, #get_resolutions, #get_statuses, #get_user_with_name, #get_versions_for_project, #login, #logout, #update_issue

Constructor Details

#initialize(endpoint_url) ⇒ JIRAService

Slightly hacky in order to set the endpoint at the initialization.

Parameters:

  • endpoint_url

    URL for the JIRA server



31
32
33
34
35
36
37
38
39
40
# File 'lib/jiraSOAP/JIRAservice.rb', line 31

def initialize(endpoint_url)
  super

  @endpoint_url = endpoint_url
  endpoint_data = {
    :uri => "#{endpoint_url}/rpc/soap/jirasoapservice-v2",
    :version => 2
  }
  self.class.endpoint endpoint_data
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object

Something to help users out until the rest of the API is implemented.

Raises:

  • (NoMethodError)


45
46
47
48
# File 'lib/jiraSOAP/JIRAservice.rb', line 45

def method_missing(method, *args)
  message  = 'Check the documentation; the method may not be implemented yet.'
  raise NoMethodError, message, caller
end

Instance Attribute Details

#auth_tokenObject (readonly)

Returns the value of attribute auth_token.



17
18
19
# File 'lib/jiraSOAP/JIRAservice.rb', line 17

def auth_token
  @auth_token
end

#userObject (readonly)

Returns the value of attribute user.



17
18
19
# File 'lib/jiraSOAP/JIRAservice.rb', line 17

def user
  @user
end

Class Method Details

.instance_at_url(url, user, password) ⇒ Object

Factory method to initialize and login.

Parameters:

  • url (String)

    URL for the JIRA server

  • user (String)

    JIRA user name to login with

  • password (String)


23
24
25
26
27
# File 'lib/jiraSOAP/JIRAservice.rb', line 23

def self.instance_at_url(url, user, password)
  jira = JIRAService.new url
  jira. user, password
  jira
end