Class: JIRA::JIRAService
- Inherits:
-
Handsoap::Service
- Object
- Handsoap::Service
- JIRA::JIRAService
- Includes:
- RemoteAPI, RemoteAPIAdditions
- Defined in:
- lib/jiraSOAP/JIRAservice.rb
Overview
consider adding a finalizer that will try to logout
HTTPS is not supported in this version.
Interface to the JIRA endpoint server.
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, but it is not enforced in case you want to be able to login as multiple users to the same endpoint.
Instance Attribute Summary collapse
- #auth_token ⇒ String readonly
- #endpoint_url ⇒ String readonly
- #user ⇒ String readonly
Class Method Summary collapse
-
.instance_with_endpoint(url, user, password) ⇒ JIRA::JIRAService
Initialize and log in.
Instance Method Summary collapse
-
#initialize(endpoint_url) ⇒ JIRAService
constructor
A new instance of JIRAService.
-
#method_missing(method, *args) ⇒ nil
deprecated
Deprecated.
This will be removed in v1.0 when the API is stable.
-
#on_create_document(doc) ⇒ Object
protected
Makes sure the correct namespace is set.
-
#on_response_document(doc) ⇒ Object
protected
Make sure that the required namespace is added.
Methods included from RemoteAPIAdditions
Methods included from RemoteAPI
#add_base64_encoded_attachments_to_issue_with_key, #add_comment_to_issue_with_key, #add_version_to_project_with_key, #create_issue_with_issue, #create_project_role_with_role, #create_project_with_project, #create_user, #delete_project_avatar_with_id, #delete_project_role, #delete_project_with_key, #delete_user_with_name, #get_attachments_for_issue_with_key, #get_comment_with_id, #get_comments_for_issue_with_key, #get_custom_fields, #get_favourite_filters, #get_issue_count_for_filter_with_id, #get_issue_types, #get_issue_types_for_project_with_id, #get_issue_with_id, #get_issue_with_key, #get_issues_from_filter_with_id, #get_issues_from_jql_search, #get_notification_schemes, #get_permission_schemes, #get_priorities, #get_project_avatar_for_key, #get_project_avatars_for_key, #get_project_including_schemes_with_id, #get_project_role_with_id, #get_project_roles, #get_project_with_id, #get_project_with_key, #get_projects_without_schemes, #get_resolution_date_for_issue_with_id, #get_resolution_date_for_issue_with_key, #get_resolutions, #get_server_configuration, #get_server_info, #get_statuses, #get_subtask_issue_types, #get_subtask_issue_types_for_project_with_id, #get_user_with_name, #get_versions_for_project, #project_role_name_unique?, #refresh_custom_fields, #release_state_for_version_for_project, #set_archive_state_for_version_for_project, #set_new_project_avatar_for_project_with_key, #set_project_avatar_for_project_with_key, #update_comment, #update_issue, #update_project_role_with_role, #update_project_with_project
Constructor Details
#initialize(endpoint_url) ⇒ JIRAService
Returns a new instance of JIRAService.
37 38 39 40 41 42 43 |
# File 'lib/jiraSOAP/JIRAservice.rb', line 37 def initialize endpoint_url @endpoint_url = endpoint_url.to_s JIRA::JIRAService.endpoint({ uri:"#{endpoint_url.to_s}/rpc/soap/jirasoapservice-v2", version:2 }) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ nil
This will be removed in v1.0 when the API is stable.
An extra note for users when things break.
48 49 50 51 52 53 |
# File 'lib/jiraSOAP/JIRAservice.rb', line 48 def method_missing method, *args = "#{method} is not a valid method. Check the documentation; the " << 'API is not stabale yet and the method name likely changed.' STDERR.puts super method, *args end |
Instance Attribute Details
#auth_token ⇒ String (readonly)
17 18 19 |
# File 'lib/jiraSOAP/JIRAservice.rb', line 17 def auth_token @auth_token end |
#endpoint_url ⇒ String (readonly)
23 24 25 |
# File 'lib/jiraSOAP/JIRAservice.rb', line 23 def endpoint_url @endpoint_url end |
#user ⇒ String (readonly)
20 21 22 |
# File 'lib/jiraSOAP/JIRAservice.rb', line 20 def user @user end |
Class Method Details
.instance_with_endpoint(url, user, password) ⇒ JIRA::JIRAService
Initialize and log in.
30 31 32 33 34 |
# File 'lib/jiraSOAP/JIRAservice.rb', line 30 def self.instance_with_endpoint url, user, password jira = JIRA::JIRAService.new url jira.login user, password jira end |
Instance Method Details
#on_create_document(doc) ⇒ Object (protected)
Makes sure the correct namespace is set
59 60 61 |
# File 'lib/jiraSOAP/JIRAservice.rb', line 59 def on_create_document doc doc.alias 'soap', 'http://soap.rpc.jira.atlassian.com' end |
#on_response_document(doc) ⇒ Object (protected)
Make sure that the required namespace is added
64 65 66 |
# File 'lib/jiraSOAP/JIRAservice.rb', line 64 def on_response_document doc doc.add_namespace 'jir', @endpoint_url end |