【问题标题】:Get available custom fields when creating new ticket in Request Tracker via REST通过 REST 在 Request Tracker 中创建新工单时获取可用的自定义字段
【发布时间】:2018-12-17 14:46:31
【问题描述】:

当我创建新工单时,我正在尝试通过Request Tracker API 为特定队列获取可用的自定义字段。例如,当我设置 Queue = 'X' 时,我希望收到一个 Custom Fields 键,其中包含可用于该队列的值ABC

当我将浏览器指向 domain/REST/1.0/ticket/new 时,我收到以下响应:

id: ticket/new
Queue: General
Requestor: xyz
Subject: 
Cc:
AdminCc:
Owner: 
Status: new
Priority: 
InitialPriority: 
FinalPriority: 
TimeEstimated: 0
Starts: 2018-12-17 15:40:43
Due: 
Attachment: 
Text: 

如您所见,我在响应中没有任何自定义字段,因为队列指向 General 而不是 X

我可以修改 URL 以将 Queue: General 更改为 Queue: X 并接收此队列可用的所有 custom fields 吗?

【问题讨论】:

  • 根据RT-Wiki,您应该向此端点发送HTTP POST 请求,包括您在票证中需要的值。简单地调用上面提到的 URI 将执行一个 HTTP GET 请求,这应该是幂等和安全的。如果我不熟悉的 RT 服务器仅通过使用 GET 请求调用该 URI 来创建新票证,那么它可能已经在做一些它不应该做的事情。尝试在终端中使用像 PostmancURL 这样的浏览器插件。

标签: rt


【解决方案1】:

您必须指定新票证请求的content 变量。例如:

1) 创建一个文件rt.file,内容为:

id: ticket/new
Queue: support
Requestor: requestor@email
Priority: 4
CF-TicketCategory: Incident
Subject: Test REST
Text: Multi line
 test with
 special chars: žščřě

2) 使用 curl 命令发布:url --data-urlencode content@rt.file --user username:password --url https://rtmachine.example.com/rest/REST/1.0/ticket/new

详情请见RT-Wiki

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-05
    • 1970-01-01
    • 2020-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-27
    相关资源
    最近更新 更多