Class: Jigit::StopIssueRunner

Inherits:
IssueRunner show all
Defined in:
lib/jigit/commands/stop_issue.rb

Instance Method Summary collapse

Methods inherited from IssueRunner

#initialize, options, #validate!

Methods inherited from Runner

#initialize, #ui

Constructor Details

This class inherits a constructor from Jigit::IssueRunner

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/jigit/commands/stop_issue.rb', line 10

def run
  self
  begin
    jira_issue = @jira_api_client.fetch_jira_issue(@issue_name)
    return unless issue_exists?(jira_issue)
    new_status = ask_for_new_status_for_issue
    put_issue_to_status(jira_issue, new_status)
  rescue Jigit::JiraInvalidIssueKeyError
    ui.say "#{@issue_name} doesn't exist on JIRA, skipping..."
  rescue Jigit::NetworkError => exception
    ui.error "Error while executing issue stop command: #{exception.message}"
  rescue Jigit::JiraAPIClientError => exception
    ui.error "Error while executing issue stop command: #{exception.message}"
  end
end