0

保持简短:

这个电话:(https://api.trello.com/1/boards/<id>/cards/?fields=all&customFieldItems=true当然是key/ token

将返回所有卡片,每个卡片都有一个属性"customFieldItems": [],但如果卡片自定义字段项具有设置值,则该值仅包含数据。

那么如何获取为特定板配置的所有customFieldItems?

4

1 回答 1

1

自定义字段是针对板定义的,因此您需要查询 Boards 端点,例如:

curl https://api.trello.com/1/boards/${BOARD_ID}/customFields?key=${TRELLO_API_KEY}&token=${TRELLO_TOKEN}

这将返回与您定义的每个自定义字段相对应的 JSON 对象数组(不仅仅是在特定卡片上设置的对象),例如:

[
  {
    "id": "8c6a9274db4ac31ba3cbd81d",
    "idModel": "560bf4298b3dda300c18d09c",
    "modelType": "board",
    "fieldGroup": "e876ca319520ce6fde0b073213df077664cda39d26385f49cf6e2cbc8ec01801",
    "display": {
      "cardFront": true
    },
    "name": "Points",
    "pos": 8192,
    "options": [
      {
        "id": "5b6a9274db4ac31ba3cbd821",
        "idCustomField": "8c6a9274db4ac31ba3cbd81d",
        "value": {
          "text": "1"
        },
        "color": "none",
        "pos": 20480
      },
      {
        "id": "5b6a9274db4ac31ba3cbd820",
        "idCustomField": "8c6a9274db4ac31ba3cbd81d",
        "value": {
          "text": "2"
        },
        "color": "none",
        "pos": 36864
      },
    ],
    "type": "list"
  },
]

请参阅:https ://developers.trello.com/v1.0/reference#boardsidcustomfields

于 2018-08-09T04:28:37.103 回答