The simplest example of getting all the data on a ticket can be as follows:
curl -X GET -u ‘root:password’ ‘MyURL/REST/2.0/ticket/1’
You can expect a return like the following:
{
“Type” : “ticket”,
“LastUpdatedBy” : {
“id” : “root”,
“_url” : “MyURL/REST/2.0/user/root”,
“type” : “user”
},
“Owner” : {
“id” : “root”,
“type” : “user”,
“_url” : “MyURL/REST/2.0/user/root”
},
“Starts” : “1970-01-01T00:00:00Z”,
“_hyperlinks” : [
{
“ref” : “self”,
“id” : “1”,
“type” : “ticket”,
“_url” : “MyURL/REST/2.0/ticket/1”
},
{
“_url” : “MyURL/REST/2.0/ticket/1/history”,
“ref” : “history”
},
{
“_url” : “MyURL/REST/2.0/ticket/1/correspond”,
“ref” : “correspond”
},
{
“ref” : “comment”,
“_url” : “MyURL/REST/2.0/ticket/1/comment”
},
{
“update” : “Comment”,
“label” : “Stall”,
“ref” : “lifecycle”,
“_url” : “MyURL/REST/2.0/ticket/1/comment”,
“to” : “stalled”,
“from” : “open”
},
{
“label” : “Resolve”,
“ref” : “lifecycle”,
“update” : “Comment”,
“from” : “open”,
“_url” : “MyURL/REST/2.0/ticket/1/comment”,
“to” : “resolved”
},
{
“update” : “Respond”,
“ref” : “lifecycle”,
“label” : “Reject”,
“to” : “rejected”,
“_url” : “MyURL/REST/2.0/ticket/1/correspond”,
“from” : “open”
}
],
“Priority” : “0”,
“TimeLeft” : “0”,
“TimeEstimated” : “0”,
“id” : 1,
“LastUpdated” : “2018-09-07T17:20:44Z”,
“Due” : “1970-01-01T00:00:00Z”,
“Queue” : {
“id” : “1”,
“type” : “queue”,
“_url” : “MyURLREST/2.0/queue/1”
},
“AdminCc” : [],
“Resolved” : “1970-01-01T00:00:00Z”,
“EffectiveId” : {
“id” : “1”,
“_url” : “MyURL/REST/2.0/ticket/1”,
“type” : “ticket”
},
“FinalPriority” : “0”,
“Creator” : {
“_url” : “MyURL/REST/2.0/user/root”,
“type” : “user”,
“id” : “root”
},
“Subject” : “My First Ticket!”,
“InitialPriority” : “0”,
“Created” : “2018-09-07T17:20:43Z”,
“Requestor” : [
{
“id” : “root”,
“_url” : “MyURL/REST/2.0/user/root”,
“type” : “user”
}
],
“TimeWorked” : “0”,
“CustomFields” : {},
“Status” : “open”,
“Cc” : [],
“Started” : “2018-09-07T17:20:43Z”
}