Skip to content

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.

AuthSession or API token with the write scope
Token limited to projectsRefused
PermissionOnly tasks the caller can open are answered

Body

FieldTypeRequiredDescription
taskIdsid[]yesThe tasks, at most 200.

Request

http
POST /api/v2/custom-fields/links/resolve
Authorization: Bearer <token>
companyid: <company id>
Content-Type: application/json

{ "taskIds": ["<task id>"] }

Response

json
{
  "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

StatusWhen
400taskIds is not a list, or lists more than 200 tasks.
401No token, a token that is invalid, expired or revoked, or no valid companyid header.
403The token lacks the write scope, or its person is no longer a member of the workspace. A token limited to projects is refused here.
429Too 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.

AuthSession or API token with the write scope
Token limited to projectsRefused
PermissionThe caller must be able to open the task and to read its custom fields

Path parameters

NameTypeDescription
fieldIdidThe voting field.

Body

FieldTypeRequiredDescription
taskIdidyesThe task.
votebooleanyestrue to cast the vote, false to withdraw it.

Any other key is refused.

Request

http
POST /api/v2/custom-fields/<fieldId>/vote
Authorization: Bearer <token>
companyid: <company id>
Content-Type: application/json

{ "taskId": "<task id>", "vote": true }

Response

json
{ "status": true, "statusText": "OK", "data": { "count": 5, "voted": true } }

count is the votes on the field after the change.

Errors

StatusWhen
400The body names more than taskId and vote, vote is not true or false, or the field is not a voting field of that task.
401No token, a token that is invalid, expired or revoked, or no valid companyid header.
403The 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.
404The task does not exist, or the caller cannot open it.
429Too many requests from this address. Wait retryAfter seconds and send it again.

Released under the AGPL-3.0 licence.