Class: CreateTicket::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/create_ticket/cli.rb

Instance Method Summary collapse

Instance Method Details

#assigneeObject



23
24
25
# File 'lib/create_ticket/cli.rb', line 23

def assignee
  ENV.fetch('JIRA_ASSIGNEE')
end

#custom_fieldsObject



31
32
33
34
# File 'lib/create_ticket/cli.rb', line 31

def custom_fields
  ENV.select { |k, _| k.start_with? 'JIRA_CUSTOMFIELD' }.to_a
     .map { |k, v| [k.downcase.sub(/^jira_/, ''), v] }.to_h
end

#duedateObject



36
37
38
# File 'lib/create_ticket/cli.rb', line 36

def duedate
  ENV['JIRA_DUEDATE']
end

#issue_typeObject



27
28
29
# File 'lib/create_ticket/cli.rb', line 27

def issue_type
  ENV.fetch('JIRA_ISSUE_TYPE')
end

#jira_tokenObject



15
16
17
# File 'lib/create_ticket/cli.rb', line 15

def jira_token
  ENV.fetch('JIRA_TOKEN')
end

#jira_urlObject



7
8
9
# File 'lib/create_ticket/cli.rb', line 7

def jira_url
  ENV.fetch('JIRA_URL')
end

#projectObject



11
12
13
# File 'lib/create_ticket/cli.rb', line 11

def project
  ENV.fetch('JIRA_PROJECT')
end

#run!Object



40
41
42
# File 'lib/create_ticket/cli.rb', line 40

def run!
  CreateTicket.new(self).create_ticket!
end

#template_filenameObject



19
20
21
# File 'lib/create_ticket/cli.rb', line 19

def template_filename
  ENV.fetch('TEMPLATE_FILENAME')
end