Commit 3b525558 authored by Marin Jankovski's avatar Marin Jankovski

Update jira service initializations.

parent cef9016b
...@@ -18,7 +18,7 @@ class JiraService < IssueTrackerService ...@@ -18,7 +18,7 @@ class JiraService < IssueTrackerService
prop_accessor :username, :password, :api_version, :jira_issue_transition_id, prop_accessor :username, :password, :api_version, :jira_issue_transition_id,
:title, :description, :project_url, :issues_url, :new_issue_url :title, :description, :project_url, :issues_url, :new_issue_url
before_validation :set_api_version before_validation :set_api_version, :set_jira_issue_transition_id
def title def title
if self.properties && self.properties['title'].present? if self.properties && self.properties['title'].present?
...@@ -49,16 +49,26 @@ class JiraService < IssueTrackerService ...@@ -49,16 +49,26 @@ class JiraService < IssueTrackerService
) )
end end
def set_api_version
self.api_version ||= "2"
end
def execute(push, issue = nil) def execute(push, issue = nil)
close_issue(push, issue) if issue close_issue(push, issue) if issue
end end
def create_cross_reference_note
# TODO implement
end
private private
def set_api_version
self.api_version ||= "2"
end
def set_jira_issue_transition_id
self.jira_issue_transition_id ||= "2"
end
def close_issue(push_data, issue_name) def close_issue(push_data, issue_name)
url = close_issue_url(issue_name) url = close_issue_url(issue_name)
commit_url = push_data[:commits].first[:url] commit_url = push_data[:commits].first[:url]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment