Class: Fastlane::Actions::AssignFixVersionsToTicketsAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/apadmi_grout/actions/assign_fix_versions_to_tickets_action.rb

Overview

Assign one or more fix versions to a list of Jira issues, skipping any that already have them

Class Method Summary collapse

Class Method Details

.authorsObject



25
26
27
# File 'lib/fastlane/plugin/apadmi_grout/actions/assign_fix_versions_to_tickets_action.rb', line 25

def self.authors
  ["samdc@apadmi.com"]
end

.available_optionsObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fastlane/plugin/apadmi_grout/actions/assign_fix_versions_to_tickets_action.rb', line 29

def self.available_options
  Apadmi::Grout::CommonOptions.board_options + [
    FastlaneCore::ConfigItem.new(key: :issues,
                                 description: "Array of Apadmi::Grout::Issue objects to assign the fix versions to. " \
                                              "Typically sourced from the third return value of generate_release_notes_action " \
                                              "(release_notes_config.release_issues)",
                                 type: Array,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :version_names,
                                 description: "The fix version names to assign",
                                 type: Array,
                                 optional: false,
                                 verify_block: proc do |value|
                                   UI.user_error!("version_names must not be empty") if value.empty?
                                 end)
  ]
end

.descriptionObject



21
22
23
# File 'lib/fastlane/plugin/apadmi_grout/actions/assign_fix_versions_to_tickets_action.rb', line 21

def self.description
  "Assign one or more fix versions to a list of Jira issues, skipping issues that already have them"
end

.is_supported?(_platform) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/fastlane/plugin/apadmi_grout/actions/assign_fix_versions_to_tickets_action.rb', line 47

def self.is_supported?(_platform)
  true
end

.run(params) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/fastlane/plugin/apadmi_grout/actions/assign_fix_versions_to_tickets_action.rb', line 11

def self.run(params)
  logger = FastLane::FastlaneLogger.new
  logger.message("Assigning fix versions #{params[:version_names]} to tickets")

  build_tools = Apadmi::Grout::DIWrapper.di(params, logger)
  build_tools.board_service.assign_fixversion_to_tickets(params[:issues], params[:version_names])

  logger.success("Fix versions assigned")
end