POST http://helix2:1900/api/PublicApi/GetEntityById
To load an entity fully, for update purposes, or for displaying full info about entity, like comments, and attachments, it is recommended to use this method. Which related data should be loaded can be set in an array-property called “Schema”. This array is optional, and valid values are:
Fields, Comments, Worklogs, Attachments, Relations, Cis, Tickets, All.
Note that for attachments only basic file-info is fetched, not the actual binary data. This need to be fetched by separate call, for each attached file.
Example call:
POST http://helix2:1900/api/PublicApi/GetEntityById
{
"EntityType": "Ticket",
"Id": 192,
}
If no schema is specified as above, the default behaviour is to load only ticket-fields, as seen below (fields excluded for brevity):
{
"Data": {
"Id": 192,
"EntityTypeId": 112,
"Version": 23,
"CreatedDate": "2015-09-02T09:56:46Z",
"UpdatedDate": "2015-09-02T13:30:21Z"
},
"Errors": null,
"IsError": false
}
Here is a request fetching comments, attachments, worklogs and relations, but not ticket fields:
{
"EntityType": "Ticket",
"Id": 4662,
"Schema": ["Comments", "Attachments", "Worklogs", "Relations"]
}
Response example:
{
"Data": {
"Id": 4662,
"EntityTypeId": 112,
"EntityType": "Ticket"
"Comments": [
{
"Id": 1617,
"EntityInstanceId": 4662,
"SourceId": 7,
"Body": "Testcomment",
"CreatedById": 1366,
"CreatedDate": "2016-02-09T09:54:22Z",
"IsPublic": true,
"IsSolution": false,
"IsWorkaround": false,
"Status": 1,
"CommentTime": 0,
"Attachments": [
]
},
{
"Id": 1625,
"EntityInstanceId": 4662,
"SourceId": 1,
"Body": "REQ0000148 has been merged into this request.",
"CreatedById": 1,
"CreatedDate": "2016-05-26T14:54:52Z",
"IsPublic": false,
"IsSolution": false,
"IsWorkaround": false,
"Status": 1,
"CommentTime": 0,
"Attachments": [
]
}
],
"Attachments": [
],
"WorkLogs": [
{
"Id": 1,
"EntityInstanceId": 4662,
"AgentId": 1,
"StartTime": "2016-05-26T00:00:00Z",
"EndTime": "2016-05-26T00:30:00Z",
"CurrencyId": 7,
"AgentCost": 0.0000,
"OtherCharges": 0.0000,
"Descriptions": "edfdfddffddfdf",
"IsCanceled": false,
"Remark": null,
"AgentRateTypeId": 0,
"Discount": 0.0000,
"InsertUserId": 1,
"InsertTime": "2016-05-26T14:24:55Z",
"LastUpdateUserId": 1,
"LastUpdateTime": "2016-05-26T14:25:02Z",
"Status": 1
}
],
"Relations": [
{
"Id": 155,
"SourceId": 4662,
"SourceEntityType": "Ticket",
"DestinationId": 4683,
"DestinationEntityType": "Ticket",
"RelationshipType": "Association",
"Status": 1
},
{
"Id": null,
"SourceId": 1470,
"SourceEntityType": "Ticket",
"DestinationId": 4662,
"DestinationEntityType": "Ticket",
"RelationshipType": "Merged",
"Status": 1
}
]
},
"Errors": null,
"IsError": false
}