Class: Apadmi::Grout::MoveTicketsAction

Inherits:
Object
  • Object
show all
Defined in:
lib/apadmi/grout/actions/move_tickets_action.rb

Overview

Moves all given tickets to a given status and assigns fix versions

Instance Method Summary collapse

Constructor Details

#initialize(board_service, logger) ⇒ MoveTicketsAction

Returns a new instance of MoveTicketsAction.

Parameters:



9
10
11
12
# File 'lib/apadmi/grout/actions/move_tickets_action.rb', line 9

def initialize(board_service, logger)
  @board_service = board_service
  @logger = logger
end

Instance Method Details

#run(version_strings, issues, new_status) ⇒ Object

Parameters:



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/apadmi/grout/actions/move_tickets_action.rb', line 17

def run(version_strings, issues, new_status)
  if issues.empty?
    @logger.error("No issues found, aborting")
    return
  end

  @logger.message("Transitioning issues: #{issues.map(&:key).join(", ")}")

  issues.each do |issue|
    @board_service.transition_issue(issue, new_status)
    @board_service.assign_fixversions(issue.key, version_strings)
  end

  @logger.success("Issues transitioned successfully :D")
end