我正在使用Zendesk API Client宝石,我在回复中包含评论时遇到问题我可以检索故障单,但它不包括对该故障单的评论我的代码在下面
ticket = ZendeskAPI::Ticket.find(client, id: 34798)
p ticket
这是我得到的回应,有什么明显的东西我在这里缺席了吗?
{
"ticket" => {
"url" =>"https://baopals.zendesk.com/api/v2/tickets/34798.json",
"id" =>34798,
"external_id" =>nil,
"via" => {
"channel" =>"api",
"source" => {
"from" => {
},
"to" => {
},
"rel" =>nil
}
},
"created_at" =>2017-11-17 09:49:11 UTC,
"updated_at" =>2017-11-17 09:49:49 UTC,
"type" =>nil,
"subject" =>"V2 test ticket",
"raw_subject" =>"V2 test ticket",
"description" =>"1111111111111111111111111111111111111111111111111111111111111111111111",
"priority" =>"normal",
"status" =>"open",
"recipient" =>nil,
"requester_id" =>15534722228,
"submitter_id" =>15534722228,
"assignee_id" =>nil,
"organization_id" =>13463857128,
"group_id" =>nil,
"collaborator_ids" => [
],
"follower_ids" => [
],
"forum_topic_id" =>nil,
"problem_id" =>nil,
"has_incidents" =>false,
"is_public" =>true,
"due_at" =>nil,
"tags" => [
],
"custom_fields" => [
{
"id" =>114097936533,
"value" =>false
},
{
"id" =>114097989754,
"value" =>false
},
{
"id" =>61510988,
"value" =>false
},
{
"id" =>114097437574,
"value" =>false
},
{
"id" =>58345127,
"value" =>nil
},
{
"id" =>76165848,
"value" =>nil
},
{
"id" =>61403888,
"value" =>nil
},
{
"id" =>60446708,
"value" =>nil
}
],
"satisfaction_rating" =>nil,
"sharing_agreement_ids" => [
],
"fields" => [
{
"id" =>114097936533,
"value" =>false
},
{
"id" =>114097989754,
"value" =>false
},
{
"id" =>61510988,
"value" =>false
},
{
"id" =>114097437574,
"value" =>false
},
{
"id" =>58345127,
"value" =>nil
},
{
"id" =>76165848,
"value" =>nil
},
{
"id" =>61403888,
"value" =>nil
},
{
"id" =>60446708,
"value" =>nil
}
],
"brand_id" =>3123448,
"allow_channelback" =>false
}
}
答案 0 :(得分:1)
票证评论实际上是此处记录的单独端点 - https://developer.zendesk.com/rest_api/docs/core/ticket_comments
看起来您可以使用ticket.comments()来获取评论
答案 1 :(得分:0)
不使用Ruby来播放我的数据,但使用Python和评论实际上是描述,我的所有类型都合并在一起。这是我到目前为止唯一看到的东西。你有没有检查过Ruby Docs文档?