Class: RoboPigeon::Dsl::JiraTicket

Inherits:
Base
  • Object
show all
Includes:
Helpers
Defined in:
lib/robopigeon/jira/ticket_dsl.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#skip

Methods included from Helpers::Markdown

#confluence_from_md, #html_from_md, #jira_from_md, #slack_from_md

Methods included from Helpers::GitLab

#deployment_code_change_stats, #deployment_diff_link, #deployment_ref, #deployment_sha, #deployment_shortlog, #deployment_time, #environment_link, #tickets_in_log_since_deployment_to

Methods included from Helpers::Slack

#slack_name_for, #slack_user_for, #slack_user_group

Methods included from Helpers::Jira

#jira_last_created_ticket, #jira_last_created_ticket_link, #jira_last_created_ticket_slack_link, #jira_slack_link

Methods included from Helpers::Git

#changed_since?, #git_branch_merged_source, #git_branch_merged_target, #git_committer_email, #git_committer_name, #git_merger_email, #git_merger_name

Methods inherited from Base

#method_missing, #respond_to_missing?

Methods inherited from Job

#gitlab, #jenkins, #jira, #slack

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RoboPigeon::Dsl::Base

Instance Attribute Details

#ticketObject

Returns the value of attribute ticket.



4
5
6
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 4

def ticket
  @ticket
end

Class Method Details

.run(ticket_number = nil, &block) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 6

def self.run(ticket_number = nil, &block)
  ticket = RoboPigeon::Jira::Ticket.new(ticket_number)
  jira = RoboPigeon::Dsl::JiraTicket.new
  jira.ticket = ticket
  jira.instance_eval(&block)
  jira.ticket.create! unless jira.ticket.ticket
  ticket
end

Instance Method Details

#assign(email) ⇒ Object



23
24
25
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 23

def assign(email)
  ticket.assign(email)
end

#comment(comment) ⇒ Object



47
48
49
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 47

def comment(comment)
  ticket.add_comment(comment)
end

#create!Object



104
105
106
107
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 104

def create!
  ticket.create!
  ticket.ticket
end

#description(text) ⇒ Object



83
84
85
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 83

def description(text)
  ticket.description = text
end

#field(name, value) ⇒ Object



118
119
120
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 118

def field(name, value)
  ticket.set_field(name, value)
end

#issuetype(type) ⇒ Object



95
96
97
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 95

def issuetype(type)
  ticket.set_issuetype type
end


127
128
129
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 127

def print_id
  puts ticket.ticket.to_s
end

#project(project_key) ⇒ Object



59
60
61
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 59

def project(project_key)
  ticket.project = project_key
end

#reporter(email) ⇒ Object



35
36
37
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 35

def reporter(email)
  ticket.set_reporter(email)
end

#summary(title) ⇒ Object



71
72
73
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 71

def summary(title)
  ticket.summary = title
end

#transition(name) ⇒ Object



139
140
141
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 139

def transition(name)
  ticket.perform_transition(name)
end

#wait_for_state(transition_state) ⇒ Object



151
152
153
# File 'lib/robopigeon/jira/ticket_dsl.rb', line 151

def wait_for_state(transition_state)
  ticket.wait_for_state!(transition_state)
end