Class: Jira::Command::Transition

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ticket, options) ⇒ Transition

Returns a new instance of Transition.



18
19
20
21
# File 'lib/jira/commands/transition.rb', line 18

def initialize(ticket, options)
  self.ticket = ticket
  self.options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



16
17
18
# File 'lib/jira/commands/transition.rb', line 16

def options
  @options
end

#ticketObject

Returns the value of attribute ticket.



16
17
18
# File 'lib/jira/commands/transition.rb', line 16

def ticket
  @ticket
end

Instance Method Details

#runObject



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/jira/commands/transition.rb', line 23

def run
  return if ticket.empty?
  return if .empty?
  return unless ['errorMessages'].nil?
  return if transition.nil? || transition.empty?

  api.post "issue/#{ticket}/transitions",
    params:  params,
    success: on_success,
    failure: on_failure
end