diff --git a/3.0/connectwise/service.go b/3.0/connectwise/service.go index 28a47c4..672946c 100644 --- a/3.0/connectwise/service.go +++ b/3.0/connectwise/service.go @@ -172,14 +172,26 @@ type Ticket struct { ContactPhoneExtension string `json:"contactPhoneExtension,omitempty"` } +<<<<<<< HEAD //TimeEntryReference is a struct to hold the unmarshaled JSON data when making a call to the Service API //TBD: For some reason the Info struct contained in TimeEntryReference does get data when the JSON is unmarshaled into this struct. The ID works fine +======= +>>>>>>> ab8a24800f1f1789b3aca8e12cc3f8ccfc1ba415 type TimeEntryReference struct { ID int Info struct { - Notes string - TimeHref string - } + Notes string `json:"notes"` + TimeHref string `json:"time_href"` + } `json:"_info"` +} + +type ConfigurationReference struct { + ID int `json:"id"` + DeviceIdentifier string `json:"deviceIdentifier"` + Info struct { + Name string `json:"name"` + ConfigurationHref string `json:"configuration_href"` + } `json:"_info"` } //GetTicketByID expects a ticket ID and returns a pointer to a Ticket struct @@ -205,3 +217,14 @@ func (cw *ConnectwiseSite) GetTicketTimeEntriesByID(ticketID int) *[]TimeEntryRe return &timeEntryReference } + +func (cw *ConnectwiseSite) GetTicketConfigurationsByID(ticketID int) *[]ConfigurationReference { + + Url := cw.BuildUrl(fmt.Sprintf("/service/tickets/%d/configurations", ticketID)) + + body := cw.GetRequest(Url) + configurationReference := []ConfigurationReference{} + check(json.Unmarshal(body, &configurationReference)) + + return &configurationReference +} diff --git a/3.0/connectwise/time.go b/3.0/connectwise/time.go index 2024022..1291fd3 100644 --- a/3.0/connectwise/time.go +++ b/3.0/connectwise/time.go @@ -73,7 +73,7 @@ type TimeEntry struct { UpdatedBy string `json:"updatedBy"` ChargeToMobileGUID string `json:"chargeToMobileGuid"` } `json:"_info"` - CustomFields struct { + CustomFields []struct { ID int Caption string Type string