我们如何 POST 在 Workfront 中自定义来自多个类别的字段

How do we POST custom fields from multiple categories in Workfront

我有两个自定义表单A1,A2,A3和表单中的字段a1,a2,a3。我想用 A1、A2 表格中的自定义字段创建一个新项目。我们应该如何在POSTURL

中包含多个categoryID
/attask/api/v10.0/PROJ?fields=parameterValues&name=XXX&DE:a1=hello&DE:a2=hello1&categoryID=<A1/A2 category ID - How should i fill it.>

我尝试添加此参数但没有成功

我收到以下错误 "message":"APIModel V10_0 does not support field categoryIDs (Project)"

如果您尝试在尚未关联该字段的对象上设置自定义字段值(包含该字段的对象上没有表单),Workfront 将自动附加适当的表单。如果这些表单是唯一使用您的字段的表单,您应该能够简单地设置字段值并完成它。

但是,如果您希望在不填写字段的情况下附加特定的自定义表单,或者如果您有一个与多个表单关联的字段并且您希望确保附加特定的表单,则必须先附加表单) 在一个调用中,然后在另一个调用中更新字段。

要附加自定义表单,

PUT <Workfront URL.../<objectID?updates={objectCategories:[{categoryID:`"<custom form ID>`",categoryOrder:<order of form, starting with 0>,objCode:`"CTGY`"}]}

请注意,这将删除此调用中未明确指定的任何表单(它不会追加),因此您需要捕获任何现有表单并 re-apply 它们。

低于 API 调用有效

POST <Workfront URL.../<object>?updates={objectCategories:[{categoryID:`"<custom form ID1>`",categoryOrder:<order of form, starting with 0>,objCode:`"CTGY`"},{categoryID:`"<custom form ID2>`",categoryOrder:<order of form, starting with 0>,objCode:`"CTGY`"}]],name:"`<object_name>`", DE:a1:"hello", DE:a2:"hello1"}