Files
mocksnow/server/models/models.go
Nathan Coad 49e60f7843
All checks were successful
continuous-integration/drone/push Build is passing
enhance implementation
2025-03-24 15:50:03 +11:00

63 lines
2.7 KiB
Go

package models
type IncidentResponse struct {
ImportSet string `json:"import_set"`
StagingTable string `json:"staging_table"`
Result []IncidentResultItem `json:"result"`
}
type IncidentResultItem struct {
TransformMap string `json:"transform_map"`
Table string `json:"table"`
DisplayName string `json:"display_name"`
DisplayValue string `json:"display_value"`
RecordLink string `json:"record_link"`
Status string `json:"status"`
SysID string `json:"sys_id"`
}
// TODO - populate more fields here
type SingleIncidentResponse struct {
IncidentNumber string `json:"incident_number,omitempty"` // The incident number in ServiceNow. If blank, creates a new incident, if populated with a valid value it updates that record.
State string `json:"state,omitempty"` // integer value, 1-6 (6 is resolved)
// Associated DeviceID (UUID from CPDB)
ExternalID string `json:"external_id,omitempty"` // CPDB UUID for the configuration item
SysID string `json:"sys_id,omitempty"`
}
type Incoming struct {
IncidentNumber string `json:"incident_number,omitempty"` // The incident number in ServiceNow. If blank, creates a new incident, if populated with a valid value it updates that record.
Description string `json:"description,omitempty"`
ShortDescription string `json:"short_description,omitempty"`
// 1 = Critical , 2 = High, 3 = Medium, 4 = Low
Urgency string `json:"urgency,omitempty"` // integer value, 1-4
// 1 = Critical , 2 = High, 3 = Medium, 4 = Low
Impact string `json:"impact,omitempty"` // integer value, 1-4
// State: 1 = New ; 2 = In Progress ; 3 = On Hold ; 6 = Resolved ; 7 = Closed ; 8 = Cancelled
State string `json:"state,omitempty"` // integer value, 1-6 (6 is resolved)
// Associated DeviceID (UUID from CPDB)
ExternalID string `json:"external_id,omitempty"` // CPDB UUID for the configuration item
WorkNotes string `json:"work_notes,omitempty"` // Additional notes
AssignmentGroup string `json:"assignment_group,omitempty"`
AssignedTo string `json:"assigned_to,omitempty"`
// Cat/SubCategory to populate the Incident appropriately
Category string `json:"category,omitempty"`
SubCategory string `json:"subcategory,omitempty"`
}
// {
// "import_set": "ABC12345",
// "staging_table": "foobar1",
// "result": [
// {
// "transform_map": "Incident Import",
// "table": "incident",
// "display_name": "number",
// "display_value": "TKT000123",
// "record_link": "https://server.fqdn.com/api/now/table/incident/640f831720eb48a107653be1b4d87225",
// "status": "inserted",
// "sys_id": "640f831720eb48a107653be1b4d87225"
// }
// ]
// }