Class: ActiveProject::Adapters::JiraAdapter
- Includes:
- ActiveProject::Adapters::Jira::AttributeNormalizer, ActiveProject::Adapters::Jira::Comments, ActiveProject::Adapters::Jira::Connection, ActiveProject::Adapters::Jira::Issues, ActiveProject::Adapters::Jira::Projects, ActiveProject::Adapters::Jira::Transitions, ActiveProject::Adapters::Jira::Webhooks
- Defined in:
- lib/active_project/adapters/jira_adapter.rb
Overview
Adapter for interacting with the Jira REST API. Implements the interface defined in ActiveProject::Adapters::Base.
Constant Summary
Constants included from ActiveProject::Adapters::Jira::Issues
ActiveProject::Adapters::Jira::Issues::DEFAULT_FIELDS
Constants included from ActiveProject::Adapters::Jira::Connection
ActiveProject::Adapters::Jira::Connection::SERAPH_HEADER
Constants included from Connections::HttpClient
Connections::HttpClient::DEFAULT_HEADERS, Connections::HttpClient::DEFAULT_RETRY_OPTS
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Store the config object.
Attributes included from Connections::HttpClient
Instance Method Summary collapse
-
#connected? ⇒ Boolean
Checks if the adapter can successfully authenticate and connect to the service.
-
#create_issue(project_id_or_key, attributes) ⇒ ActiveProject::Resources::Issue
Creates an issue in Jira.
-
#get_current_user ⇒ ActiveProject::Resources::User
Retrieves details for the currently authenticated user.
-
#issues ⇒ ResourceFactory<Resources::Issue>
Returns a factory for Issue resources.
-
#projects ⇒ ResourceFactory<Resources::Project>
Returns a factory for Project resources.
-
#update_issue(id_or_key, attributes, context = {}) ⇒ ActiveProject::Resources::Issue
Updates an issue in Jira.
Methods included from ActiveProject::Adapters::Jira::Webhooks
Methods included from ActiveProject::Adapters::Jira::Transitions
Methods included from ActiveProject::Adapters::Jira::Comments
#add_comment, #delete_comment, #update_comment
Methods included from ActiveProject::Adapters::Jira::Issues
#adf_text, #delete_issue, #find_issue, #list_issues
Methods included from ActiveProject::Adapters::Jira::Projects
#create_project, #delete_project, #find_project, #list_projects
Methods included from ActiveProject::Adapters::Jira::Connection
Methods included from Connections::Rest
Methods included from Connections::Pagination
Methods included from Connections::HttpClient
Methods included from Connections::Base
Methods included from ActiveProject::Adapters::Jira::AttributeNormalizer
Methods inherited from Base
#add_comment, #create_list, #create_project, #delete_comment, #delete_issue, #delete_project, #denormalize_status, #find_issue, #find_project, #initialize, #list_issues, #list_projects, #normalize_status, #parse_webhook, #status_known?, #supports_webhooks?, #update_comment, #valid_statuses, #verify_webhook_signature, webhook_type, #webhook_type
Instance Attribute Details
#config ⇒ Object (readonly)
Store the config object
15 16 17 |
# File 'lib/active_project/adapters/jira_adapter.rb', line 15 def config @config end |
Instance Method Details
#connected? ⇒ Boolean
Checks if the adapter can successfully authenticate and connect to the service. Calls #get_current_user internally and catches authentication errors.
67 68 69 70 71 72 |
# File 'lib/active_project/adapters/jira_adapter.rb', line 67 def connected? get_current_user true rescue ActiveProject::AuthenticationError false end |
#create_issue(project_id_or_key, attributes) ⇒ ActiveProject::Resources::Issue
Creates an issue in Jira.
42 43 44 |
# File 'lib/active_project/adapters/jira_adapter.rb', line 42 def create_issue(project_id_or_key, attributes) super(project_id_or_key, normalize_issue_attrs(attributes)) end |
#get_current_user ⇒ ActiveProject::Resources::User
Retrieves details for the currently authenticated user.
59 60 61 62 |
# File 'lib/active_project/adapters/jira_adapter.rb', line 59 def get_current_user user_data = make_request(:get, "/rest/api/3/myself") map_user_data(user_data) end |
#issues ⇒ ResourceFactory<Resources::Issue>
Returns a factory for Issue resources.
34 35 36 |
# File 'lib/active_project/adapters/jira_adapter.rb', line 34 def issues ResourceFactory.new(adapter: self, resource_class: Resources::Issue) end |
#projects ⇒ ResourceFactory<Resources::Project>
Returns a factory for Project resources.
28 29 30 |
# File 'lib/active_project/adapters/jira_adapter.rb', line 28 def projects ResourceFactory.new(adapter: self, resource_class: Resources::Project) end |
#update_issue(id_or_key, attributes, context = {}) ⇒ ActiveProject::Resources::Issue
Updates an issue in Jira.
51 52 53 |
# File 'lib/active_project/adapters/jira_adapter.rb', line 51 def update_issue(id_or_key, attributes, context = {}) super(id_or_key, normalize_issue_attrs(attributes), context) end |