Class: JiraRemotelinker::REST::AbstractV2
- Inherits:
-
Object
- Object
- JiraRemotelinker::REST::AbstractV2
- Includes:
- HTTParty
- Defined in:
- lib/jira-remotelinker/rest.rb
Overview
An abstract template class that talks to v2 of the JIRA API. Instantiate concrete subclasses using the module function ‘factory`.
Constant Summary collapse
- API_PATH =
'rest/api/2'
Class Attribute Summary collapse
-
.jira_name ⇒ Object
Returns the value of attribute jira_name.
-
.jira_type ⇒ Object
Returns the value of attribute jira_type.
-
.jira_url ⇒ Object
Returns the value of attribute jira_url.
-
.jira_uuid ⇒ Object
Returns the value of attribute jira_uuid.
Class Method Summary collapse
- .delete_issue_remotelink(issue_key, link_id) ⇒ Object
- .get_issue(issue_key) ⇒ Object
- .get_issue_remotelinks(issue_key) ⇒ Object
- .post_issue_remotelink(issue_key, relationship, target_jira, target_key, target_id) ⇒ Object
Class Attribute Details
.jira_name ⇒ Object
Returns the value of attribute jira_name.
14 15 16 |
# File 'lib/jira-remotelinker/rest.rb', line 14 def jira_name @jira_name end |
.jira_type ⇒ Object
Returns the value of attribute jira_type.
14 15 16 |
# File 'lib/jira-remotelinker/rest.rb', line 14 def jira_type @jira_type end |
.jira_url ⇒ Object
Returns the value of attribute jira_url.
14 15 16 |
# File 'lib/jira-remotelinker/rest.rb', line 14 def jira_url @jira_url end |
.jira_uuid ⇒ Object
Returns the value of attribute jira_uuid.
14 15 16 |
# File 'lib/jira-remotelinker/rest.rb', line 14 def jira_uuid @jira_uuid end |
Class Method Details
.delete_issue_remotelink(issue_key, link_id) ⇒ Object
42 43 44 |
# File 'lib/jira-remotelinker/rest.rb', line 42 def self.delete_issue_remotelink(issue_key, link_id) delete "/issue/#{issue_key}/remotelink/#{link_id}" end |
.get_issue(issue_key) ⇒ Object
17 18 19 |
# File 'lib/jira-remotelinker/rest.rb', line 17 def self.get_issue(issue_key) get "/issue/#{issue_key}" end |
.get_issue_remotelinks(issue_key) ⇒ Object
21 22 23 |
# File 'lib/jira-remotelinker/rest.rb', line 21 def self.get_issue_remotelinks(issue_key) get "/issue/#{issue_key}/remotelink" end |
.post_issue_remotelink(issue_key, relationship, target_jira, target_key, target_id) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/jira-remotelinker/rest.rb', line 25 def self.post_issue_remotelink(issue_key, relationship, target_jira, target_key, target_id) link_data = { 'globalId' => "appId=#{target_jira.jira_uuid}&issueId=#{target_id}", 'application' => { 'type' => target_jira.jira_type, 'name' => target_jira.jira_name }, 'relationship' => relationship, 'object' => { 'url' => "#{target_jira.jira_url}/browse/#{target_key}", 'title' => target_key } } post "/issue/#{issue_key}/remotelink", {:body => link_data.to_json, :headers => {'Content-Type' => 'application/json'}} end |