Class: RedmineAPI::Issue

Inherits:
Base
  • Object
show all
Defined in:
lib/provider/api-extensions.rb,
lib/redmine/redmine-api.rb

Overview

Reopening class to add ticket master espesific behavior without mixing it with RadmineAPI

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

headers, inherited

Class Method Details

.find(*arguments) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/redmine/redmine-api.rb', line 34

def self.find(*arguments)
  scope   = arguments.slice!(0)
  options = arguments.slice!(0) || {}
  # By including journals, we can get Notes aka Comments
  # RedmineAPI::Issue.find(2180, :params => {:include => 'journals'})
  get_comments = {:include => 'journals'}
  if options[:params].nil?
    options[:params] = get_comments
  else
    options[:params].merge!(get_comments)
  end
  super scope, options
end

Instance Method Details

#to_ticket_hashObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/provider/api-extensions.rb', line 3

def to_ticket_hash
  return  :id => id.to_i,
    :title => subject,
    :created_at => created_on,
    :updated_at => updated_on,
    :project_id => project.id.to_i,
    :status => status.name,
    :priority => priority.name,
    :priority_id => priority.id.to_i, 
    :requestor => author.name,
    :assignee => author.name
end

#update_with(ticket) ⇒ Object



16
17
18
19
20
21
# File 'lib/provider/api-extensions.rb', line 16

def update_with(ticket)
  self.subject = ticket.title
  self.project_id = ticket.project_id
  self.description = ticket.description
  self
end