Class: SysAid::Ticket
- Inherits:
-
Object
- Object
- SysAid::Ticket
- Defined in:
- lib/sysaid/ticket.rb
Instance Attribute Summary collapse
-
#agreement ⇒ Object
Returns the value of attribute agreement.
-
#archive ⇒ Object
Returns the value of attribute archive.
-
#assignCounter ⇒ Object
Returns the value of attribute assignCounter.
-
#assignedGroup ⇒ Object
Returns the value of attribute assignedGroup.
-
#assignedTo ⇒ Object
Returns the value of attribute assignedTo.
-
#category ⇒ Object
Returns the value of attribute category.
-
#cc ⇒ Object
Returns the value of attribute cc.
-
#changeCategory ⇒ Object
Returns the value of attribute changeCategory.
-
#ciid ⇒ Object
Returns the value of attribute ciid.
-
#closeTime ⇒ Object
Returns the value of attribute closeTime.
-
#closureInformation ⇒ Object
Returns the value of attribute closureInformation.
-
#computerID ⇒ Object
Returns the value of attribute computerID.
-
#currentSupportLevel ⇒ Object
Returns the value of attribute currentSupportLevel.
-
#custInt1 ⇒ Object
Returns the value of attribute custInt1.
-
#custInt2 ⇒ Object
Returns the value of attribute custInt2.
-
#custList1 ⇒ Object
Returns the value of attribute custList1.
-
#custList2 ⇒ Object
Returns the value of attribute custList2.
-
#custNotes ⇒ Object
Returns the value of attribute custNotes.
-
#custText1 ⇒ Object
Returns the value of attribute custText1.
-
#custText2 ⇒ Object
Returns the value of attribute custText2.
-
#description ⇒ Object
Returns the value of attribute description.
-
#escalation ⇒ Object
Returns the value of attribute escalation.
-
#id ⇒ Object
Returns the value of attribute id.
-
#impact ⇒ Object
Returns the value of attribute impact.
-
#location ⇒ Object
Returns the value of attribute location.
-
#maxSupportLevel ⇒ Object
Returns the value of attribute maxSupportLevel.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#parentLink ⇒ Object
Returns the value of attribute parentLink.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#projectID ⇒ Object
Returns the value of attribute projectID.
-
#reopenCounter ⇒ Object
Returns the value of attribute reopenCounter.
-
#requestUser ⇒ Object
Returns the value of attribute requestUser.
-
#resolution ⇒ Object
Returns the value of attribute resolution.
-
#solution ⇒ Object
Returns the value of attribute solution.
-
#source ⇒ Object
Returns the value of attribute source.
-
#srSubType ⇒ Object
Returns the value of attribute srSubType.
-
#srType ⇒ Object
Returns the value of attribute srType.
-
#status ⇒ Object
Returns the value of attribute status.
-
#subCategory ⇒ Object
Returns the value of attribute subCategory.
-
#submitUser ⇒ Object
Returns the value of attribute submitUser.
-
#successRating ⇒ Object
Returns the value of attribute successRating.
-
#taskID ⇒ Object
Returns the value of attribute taskID.
-
#thirdLevelCategory ⇒ Object
Returns the value of attribute thirdLevelCategory.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updateTime ⇒ Object
Returns the value of attribute updateTime.
-
#updateUser ⇒ Object
Returns the value of attribute updateUser.
-
#urgency ⇒ Object
Returns the value of attribute urgency.
-
#userManager ⇒ Object
Returns the value of attribute userManager.
-
#version ⇒ Object
Returns the value of attribute version.
-
#workaround ⇒ Object
Returns the value of attribute workaround.
Class Method Summary collapse
Instance Method Summary collapse
-
#delete ⇒ Object
Deletes a ticket from the SysAid server.
-
#initialize ⇒ Ticket
constructor
A new instance of Ticket.
-
#refresh ⇒ Object
Loads the latest user information from the SysAid server.
-
#save ⇒ Object
Saves a ticket back to the SysAid server.
Constructor Details
#initialize ⇒ Ticket
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
#agreement ⇒ Object
Returns the value of attribute agreement.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def agreement @agreement end |
#archive ⇒ Object
Returns the value of attribute archive.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def archive @archive end |
#assignCounter ⇒ Object
Returns the value of attribute assignCounter.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def assignCounter @assignCounter end |
#assignedGroup ⇒ Object
Returns the value of attribute assignedGroup.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def assignedGroup @assignedGroup end |
#assignedTo ⇒ Object
Returns the value of attribute assignedTo.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def assignedTo @assignedTo end |
#category ⇒ Object
Returns the value of attribute category.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def category @category end |
#cc ⇒ Object
Returns the value of attribute cc.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def cc @cc end |
#changeCategory ⇒ Object
Returns the value of attribute changeCategory.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def changeCategory @changeCategory end |
#ciid ⇒ Object
Returns the value of attribute ciid.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def ciid @ciid end |
#closeTime ⇒ Object
Returns the value of attribute closeTime.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def closeTime @closeTime end |
#closureInformation ⇒ Object
Returns the value of attribute closureInformation.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def closureInformation @closureInformation end |
#computerID ⇒ Object
Returns the value of attribute computerID.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def computerID @computerID end |
#currentSupportLevel ⇒ Object
Returns the value of attribute currentSupportLevel.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def currentSupportLevel @currentSupportLevel end |
#custInt1 ⇒ Object
Returns the value of attribute custInt1.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def custInt1 @custInt1 end |
#custInt2 ⇒ Object
Returns the value of attribute custInt2.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def custInt2 @custInt2 end |
#custList1 ⇒ Object
Returns the value of attribute custList1.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def custList1 @custList1 end |
#custList2 ⇒ Object
Returns the value of attribute custList2.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def custList2 @custList2 end |
#custNotes ⇒ Object
Returns the value of attribute custNotes.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def custNotes @custNotes end |
#custText1 ⇒ Object
Returns the value of attribute custText1.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def custText1 @custText1 end |
#custText2 ⇒ Object
Returns the value of attribute custText2.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def custText2 @custText2 end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def description @description end |
#escalation ⇒ Object
Returns the value of attribute escalation.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def escalation @escalation end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def id @id end |
#impact ⇒ Object
Returns the value of attribute impact.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def impact @impact end |
#location ⇒ Object
Returns the value of attribute location.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def location @location end |
#maxSupportLevel ⇒ Object
Returns the value of attribute maxSupportLevel.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def maxSupportLevel @maxSupportLevel end |
#notes ⇒ Object
Returns the value of attribute notes.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def notes @notes end |
#parentLink ⇒ Object
Returns the value of attribute parentLink.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def parentLink @parentLink end |
#priority ⇒ Object
Returns the value of attribute priority.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def priority @priority end |
#projectID ⇒ Object
Returns the value of attribute projectID.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def projectID @projectID end |
#reopenCounter ⇒ Object
Returns the value of attribute reopenCounter.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def reopenCounter @reopenCounter end |
#requestUser ⇒ Object
Returns the value of attribute requestUser.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def requestUser @requestUser end |
#resolution ⇒ Object
Returns the value of attribute resolution.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def resolution @resolution end |
#solution ⇒ Object
Returns the value of attribute solution.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def solution @solution end |
#source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def source @source end |
#srSubType ⇒ Object
Returns the value of attribute srSubType.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def srSubType @srSubType end |
#srType ⇒ Object
Returns the value of attribute srType.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def srType @srType end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def status @status end |
#subCategory ⇒ Object
Returns the value of attribute subCategory.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def subCategory @subCategory end |
#submitUser ⇒ Object
Returns the value of attribute submitUser.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def submitUser @submitUser end |
#successRating ⇒ Object
Returns the value of attribute successRating.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def successRating @successRating end |
#taskID ⇒ Object
Returns the value of attribute taskID.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def taskID @taskID end |
#thirdLevelCategory ⇒ Object
Returns the value of attribute thirdLevelCategory.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def thirdLevelCategory @thirdLevelCategory end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def title @title end |
#updateTime ⇒ Object
Returns the value of attribute updateTime.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def updateTime @updateTime end |
#updateUser ⇒ Object
Returns the value of attribute updateUser.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def updateUser @updateUser end |
#urgency ⇒ Object
Returns the value of attribute urgency.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def urgency @urgency end |
#userManager ⇒ Object
Returns the value of attribute userManager.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def userManager @userManager end |
#version ⇒ Object
Returns the value of attribute version.
4 5 6 |
# File 'lib/sysaid/ticket.rb', line 4 def version @version end |
#workaround ⇒ Object
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
#delete ⇒ Object
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 |
#refresh ⇒ Object
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 |
#save ⇒ Object
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 |