IMPORTANT! The information on this page is unverified and unsupported. Always double-check the accuracy of the solutions provided. Evaluate and test the impact on any environments!
Swagger - Adding and Updating Values to a Table Column
Description
How to populate table field column values from Swagger API when using POST /trackers/{trackerId}/items or PUT /items/{itemId}/fields?
Observed on
- codebeamer release 22.04 (FELICITY)
Solution
It is recommended to always include the table fieldId in the json payload, for example:
POST /v3/trackers/{trackerId}/items
{
"customFields": [
{
"fieldId": 1000000,
"name": "mytablefield",
"values": [
[
{
"fieldId": 1000001,
"name": "Mycolumnfield",
"value": "myrowedited",
"type": "TextFieldValue"
}
]
],
"type": "TableFieldValue"
}
],
"description": "My Item description",
"descriptionFormat": "PlainText",
"name": "My Item summary",
"status": {
"id": 1,
"name": "ToDo",
"type": "ChoiceOptionReference"
}
}
or
PUT /v3/items/{itemId}/fields
{
"tableValues": [
{
"fieldId": 1000000,
"name": "mytablefield",
"values": [
[
{
"fieldId": 1000001,
"name": "Mycolumnfield",
"value": "myrowedited",
"type": "TextFieldValue"
}
]
],
"type": "TableFieldValue"
}
]
}
Using "Shorthand" payloads without table fieldId, like:
POST /v3/trackers/{trackerId}/items
{
"customFields": [
{
"value": "myrowedited",
"fieldId": 1000001,
"type": "TextFieldValue"
},
... // other fields
]
}
or
PUT /v3/items/{itemId}/fields
{
"fieldValues": [
{
"value": "myrowedited",
"fieldId": 1000001,
"type": "TextFieldValue"
},
... // other fields
]
}
is also possible, however, these do not work with more complex field types, for example, with Choice fields.
For any other Support options, questions, or inputs, visit: https://intland.com/technical-support/