Class: Abide::CLI::JiraFromXccdfCommand
- Inherits:
-
CmdParse::Command
- Object
- CmdParse::Command
- Abide::CLI::JiraFromXccdfCommand
- Defined in:
- lib/abide_dev_utils/cli/jira.rb
Constant Summary collapse
- CMD_NAME =
'from-xccdf'
- CMD_SHORT =
'Creates a parent issue with subtasks from a xccdf file'
- CMD_LONG =
'Creates a parent issue with subtasks for a benchmark and any uncovered controls'
Instance Method Summary collapse
- #execute(path, project) ⇒ Object
-
#initialize ⇒ JiraFromXccdfCommand
constructor
A new instance of JiraFromXccdfCommand.
Constructor Details
#initialize ⇒ JiraFromXccdfCommand
Returns a new instance of JiraFromXccdfCommand.
123 124 125 126 127 128 129 130 |
# File 'lib/abide_dev_utils/cli/jira.rb', line 123 def initialize super(CMD_NAME, takes_commands: false) short_desc(CMD_SHORT) long_desc(CMD_LONG) argument_desc(PATH: 'An XCCDF file', PROJECT: 'A Jira project') .on('-d', '--dry-run', 'Print to console instead of saving objects') { |_| @data[:dry_run] = true } .on('-e [EPIC]', '--epic [EPIC]', 'If given, tasks will be created and assigned to this epic. Takes form <PROJECT>-<NUM>') { |e| @data[:epic] = e } end |
Instance Method Details
#execute(path, project) ⇒ Object
132 133 134 135 136 137 138 |
# File 'lib/abide_dev_utils/cli/jira.rb', line 132 def execute(path, project) Abide::CLI::VALIDATE.file(path) @data[:dry_run] = false if @data[:dry_run].nil? client = JIRA.client(options: {}) proj = JIRA.project(client, project) JIRA.new_issues_from_xccdf(client, proj, path, epic: @data[:epic], dry_run: @data[:dry_run]) end |