Class: SysAid::Ticket

Inherits:
Object
  • Object
show all
Defined in:
lib/sysaid/ticket.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTicket

Returns a new instance of Ticket.



12
13
14
15
# File 'lib/sysaid/ticket.rb', line 12

def initialize
  self.closeTime = Date.new
  self.updateTime = Date.new
end

Instance Attribute Details

#agreementObject

Returns the value of attribute agreement.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def agreement
  @agreement
end

#archiveObject

Returns the value of attribute archive.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def archive
  @archive
end

#assignCounterObject

Returns the value of attribute assignCounter.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def assignCounter
  @assignCounter
end

#assignedGroupObject

Returns the value of attribute assignedGroup.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def assignedGroup
  @assignedGroup
end

#assignedToObject

Returns the value of attribute assignedTo.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def assignedTo
  @assignedTo
end

#categoryObject

Returns the value of attribute category.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def category
  @category
end

#ccObject

Returns the value of attribute cc.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def cc
  @cc
end

#changeCategoryObject

Returns the value of attribute changeCategory.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def changeCategory
  @changeCategory
end

#ciidObject

Returns the value of attribute ciid.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def ciid
  @ciid
end

#closeTimeObject

Returns the value of attribute closeTime.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def closeTime
  @closeTime
end

#closureInformationObject

Returns the value of attribute closureInformation.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def closureInformation
  @closureInformation
end

#computerIDObject

Returns the value of attribute computerID.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def computerID
  @computerID
end

#currentSupportLevelObject

Returns the value of attribute currentSupportLevel.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def currentSupportLevel
  @currentSupportLevel
end

#custInt1Object

Returns the value of attribute custInt1.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def custInt1
  @custInt1
end

#custInt2Object

Returns the value of attribute custInt2.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def custInt2
  @custInt2
end

#custList1Object

Returns the value of attribute custList1.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def custList1
  @custList1
end

#custList2Object

Returns the value of attribute custList2.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def custList2
  @custList2
end

#custNotesObject

Returns the value of attribute custNotes.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def custNotes
  @custNotes
end

#custText1Object

Returns the value of attribute custText1.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def custText1
  @custText1
end

#custText2Object

Returns the value of attribute custText2.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def custText2
  @custText2
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def description
  @description
end

#escalationObject

Returns the value of attribute escalation.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def escalation
  @escalation
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def id
  @id
end

#impactObject

Returns the value of attribute impact.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def impact
  @impact
end

#locationObject

Returns the value of attribute location.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def location
  @location
end

#maxSupportLevelObject

Returns the value of attribute maxSupportLevel.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def maxSupportLevel
  @maxSupportLevel
end

#notesObject

Returns the value of attribute notes.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def notes
  @notes
end

Returns the value of attribute parentLink.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def parentLink
  @parentLink
end

#priorityObject

Returns the value of attribute priority.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def priority
  @priority
end

#projectIDObject

Returns the value of attribute projectID.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def projectID
  @projectID
end

#reopenCounterObject

Returns the value of attribute reopenCounter.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def reopenCounter
  @reopenCounter
end

#requestUserObject

Returns the value of attribute requestUser.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def requestUser
  @requestUser
end

#resolutionObject

Returns the value of attribute resolution.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def resolution
  @resolution
end

#solutionObject

Returns the value of attribute solution.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def solution
  @solution
end

#sourceObject

Returns the value of attribute source.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def source
  @source
end

#srSubTypeObject

Returns the value of attribute srSubType.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def srSubType
  @srSubType
end

#srTypeObject

Returns the value of attribute srType.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def srType
  @srType
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def status
  @status
end

#subCategoryObject

Returns the value of attribute subCategory.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def subCategory
  @subCategory
end

#submitUserObject

Returns the value of attribute submitUser.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def submitUser
  @submitUser
end

#successRatingObject

Returns the value of attribute successRating.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def successRating
  @successRating
end

#taskIDObject

Returns the value of attribute taskID.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def taskID
  @taskID
end

#thirdLevelCategoryObject

Returns the value of attribute thirdLevelCategory.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def thirdLevelCategory
  @thirdLevelCategory
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def title
  @title
end

#updateTimeObject

Returns the value of attribute updateTime.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def updateTime
  @updateTime
end

#updateUserObject

Returns the value of attribute updateUser.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def updateUser
  @updateUser
end

#urgencyObject

Returns the value of attribute urgency.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def urgency
  @urgency
end

#userManagerObject

Returns the value of attribute userManager.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def userManager
  @userManager
end

#versionObject

Returns the value of attribute version.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def version
  @version
end

#workaroundObject

Returns the value of attribute workaround.



4
5
6
# File 'lib/sysaid/ticket.rb', line 4

def workaround
  @workaround
end

Class Method Details

.find_by_id(ticket_id) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/sysaid/ticket.rb', line 17

def self.find_by_id(ticket_id)
  ticket = SysAid::Ticket.new
  
  ticket.id = ticket_id
  
  return nil unless ticket.refresh
  
  return ticket
end

Instance Method Details

#deleteObject

Deletes a ticket from the SysAid server

No return value as SysAid’s ‘delete’ call returns void. No idea why.

Example:

>> ticket_object.delete
=> true


65
66
67
# File 'lib/sysaid/ticket.rb', line 65

def delete
  SysAid.client.call(:delete, message: to_xml(false))
end

#refreshObject

Loads the latest user information from the SysAid server



28
29
30
31
32
33
34
35
36
37
# File 'lib/sysaid/ticket.rb', line 28

def refresh
  response = SysAid.client.call(:load_by_string_id, message: to_xml)
  
  if response.to_hash[:load_by_string_id_response][:return]
    set_self_from_response(response.to_hash[:load_by_string_id_response][:return])
    return true
  end
  
  return false
end

#saveObject

Saves a ticket back to the SysAid server

Example:

>> ticket_object.save
=> true


44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/sysaid/ticket.rb', line 44

def save
  if SysAid.logged_in? == false
    raise "You must log in before creating or saving a ticket."
  end
  
  # Save it via the SOAP API
  response = SysAid.client.call(:save, message: to_xml(false))
  if response.to_hash[:save_response][:return]
    return true
  else
    return false
  end
end