Class: Jira::Command::Link

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ticket) ⇒ Link

Returns a new instance of Link.



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

def initialize(ticket)
  self.ticket = ticket
end

Instance Attribute Details

#ticketObject

Returns the value of attribute ticket.



14
15
16
# File 'lib/jira/commands/link.rb', line 14

def ticket
  @ticket
end

Instance Method Details

#runObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/jira/commands/link.rb', line 20

def run
  return if ticket.empty?
  return if .empty?
  return if issue_link_type.empty?
  return if outward_ticket.empty?
  return unless invalid_ticket?

  begin
    api.post "issueLink",
      params: params,
      success: on_success,
      failure: on_failure
  rescue CommandException
  end
end