Custom fields
Reading the tasks a relationship field links and the votes on a voting field, and casting a vote.
Resolve relationship and voting values
POST /api/v2/custom-fields/links/resolve · beta
Returns, for each task named, the tasks its relationship fields link and the tally of its voting fields.
A task the caller cannot open is left out as if it held nothing. A linked task the caller cannot open is left out of its list. The voters of a field are named only when the field shows them. A task with no values is not in the answer.
| Auth | Session or API token with the write scope |
| Token limited to projects | Refused |
| Permission | Only tasks the caller can open are answered |
Body
| Field | Type | Required | Description |
|---|---|---|---|
taskIds | id[] | yes | The tasks, at most 200. |
Request
POST /api/v2/custom-fields/links/resolve
Authorization: Bearer <token>
companyid: <company id>
Content-Type: application/json
{ "taskIds": ["<task id>"] }Response
{
"status": true,
"statusText": "OK",
"data": {
"<task id>": {
"<relationship field id>": [
{
"id": "<task id>",
"key": "WEB-12",
"title": "Write the release notes",
"status": { "key": 1, "text": "Open", "type": "default_active" },
"projectId": "<project id>",
"sprintId": "<list id>",
"folderId": ""
}
],
"<voting field id>": { "count": 4, "voted": true }
}
}
}A relationship field answers with its linked tasks. A voting field answers with count, voted (whether the caller has voted) and, when the field shows voters, voters, a list of user ids.
Errors
| Status | When |
|---|---|
| 400 | taskIds is not a list, or lists more than 200 tasks. |
| 401 | No token, a token that is invalid, expired or revoked, or no valid companyid header. |
| 403 | The token lacks the write scope, or its person is no longer a member of the workspace. A token limited to projects is refused here. |
| 429 | Too many requests from this address. Wait retryAfter seconds and send it again. |
Vote on a task
POST /api/v2/custom-fields/:fieldId/vote · beta
Casts or withdraws the caller's own vote on a voting field of a task.
The voter is always the caller.
| Auth | Session or API token with the write scope |
| Token limited to projects | Refused |
| Permission | The caller must be able to open the task and to read its custom fields |
Path parameters
| Name | Type | Description |
|---|---|---|
fieldId | id | The voting field. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
taskId | id | yes | The task. |
vote | boolean | yes | true to cast the vote, false to withdraw it. |
Any other key is refused.
Request
POST /api/v2/custom-fields/<fieldId>/vote
Authorization: Bearer <token>
companyid: <company id>
Content-Type: application/json
{ "taskId": "<task id>", "vote": true }Response
{ "status": true, "statusText": "OK", "data": { "count": 5, "voted": true } }count is the votes on the field after the change.
Errors
| Status | When |
|---|---|
| 400 | The body names more than taskId and vote, vote is not true or false, or the field is not a voting field of that task. |
| 401 | No token, a token that is invalid, expired or revoked, or no valid companyid header. |
| 403 | The token lacks the write scope, or its person is no longer a member of the workspace. A token limited to projects is refused here. The caller's role gives no access to the custom fields of the task. |
| 404 | The task does not exist, or the caller cannot open it. |
| 429 | Too many requests from this address. Wait retryAfter seconds and send it again. |
