Class: Jigit::StartIssueRunner

Inherits:
IssueRunner show all
Defined in:
lib/jigit/commands/start_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/start_issue.rb', line 10

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