【问题标题】:How do we POST custom fields from multiple categories in Workfront我们如何在 Workfront 中发布来自多个类别的自定义字段
【发布时间】:2019-06-24 11:25:37
【问题描述】:

我有两个自定义表单 A1,A2,A3 和表单中的字段 a1,a2,a3。我想使用表单 A1、A2 中的自定义字段创建一个新项目。我们应该如何在 POST URL 中包含多个 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.>

我尝试添加此参数,但没有运气 categoryIDs=5d10971f0022b132ec67f6fb6c60b3a4,5d07244000060f86c04b49527f1

我收到以下错误“消息”:“APIModel V10_0 不支持字段 categoryIDs(项目)”

【问题讨论】:

    标签: forms rest custom-fields workfront-api


    【解决方案1】:

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

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

    要附加自定义表单,

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

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

    【讨论】:

    • 我想知道 POST 方法是否允许我们从多个自定义表单创建一个具有多个自定义字段(不同自定义字段)的对象(这里说项目)。如果是,我们如何在请求 URL 中给出多个表单的类别 ID
    【解决方案2】:

    以下 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"} 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-15
      • 1970-01-01
      • 2023-04-11
      • 1970-01-01
      • 1970-01-01
      • 2018-04-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多