Class: Jira::Command::New

Inherits:
Base
  • Object
show all
Defined in:
lib/jira/commands/new.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ New

Returns a new instance of New.



23
24
25
# File 'lib/jira/commands/new.rb', line 23

def initialize(options)
  self.options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



21
22
23
# File 'lib/jira/commands/new.rb', line 21

def options
  @options
end

Instance Method Details

#runObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/jira/commands/new.rb', line 27

def run
  return if .empty?
  return if project.nil? || project.empty?
  return if .empty?
  components # Select components if any after a project
  return if issue_type.nil? || issue_type.empty?
  return if assign_parent? && parent.empty?
  return if summary.empty?

  api.post 'issue',
    params: params,
    success: on_success,
    failure: on_failure
end