Tasks
The trial's task board is a simple kanban for the study team: tasks with assignees and due dates, moved between lanes. Reading every task needs trial.readTasks; creating, editing and deleting them needs trial.writeTasks, which includes reading. A task can be for one or more sites (sites): site.readTasks on a site reads its tasks, and site.writeTasks creates, edits and deletes them, may only give a task sites it holds the permission on (and must give it at least one), and may only assign it to staff of the task's sites it holds the permission on (members with site.access, or anyone holding site.read, site.write, site.readTasks or site.writeTasks there). A task with no sites is seen only with trial.readTasks. Anyone else with access to the trial sees only the tasks assigned to them, and may change those tasks' taskLane, index, status, dueDate and description, but not their title or assignees, and may not delete them. Lanes are visible to everyone on the trial and managed by trial admins.
Endpoints
| Method | Path | Description |
|---|---|---|
GET |
/trials/<trialId>/tasks |
The tasks you can see, as {"tasks": [...], "canReadAll": ..., "canWrite": ..., "canManageLanes": ..., "writableSites": [...], "sites": [...]}. Without trial.readTasks, the tasks at the sites you read tasks at and those assigned to you. writableSites are the sites you manage tasks at; sites (_id, name) the sites you may see named. |
POST |
/trials/<trialId>/tasks |
Create a task. |
GET |
/trials/<trialId>/tasks/assignable-users |
The people a task may be assigned to, as {"users": [...]}: everyone who can open the trial, for trial.writeTasks. With site.writeTasks only, pass the task's sites as ?sites=<siteId>,<siteId> for the staff of those you hold it on; sites you don't hold it on are ignored. |
GET |
/tasks/<taskId> |
One task. |
PUT |
/tasks/<taskId> |
Update a task. |
DELETE |
/tasks/<taskId> |
Delete a task. |
GET |
/trials/<trialId>/task-lanes |
The board's lanes, as {"lanes": [...]}. |
POST |
/trials/<trialId>/task-lanes |
Add a lane. |
PUT DELETE |
/task-lanes/<laneId> |
Rename, reorder or remove a lane. |
Task fields
| Field | Type | Notes |
|---|---|---|
title |
string | |
description |
string | |
taskLane |
lane _id |
The lane the task is in. |
index |
integer | Position within the lane. |
query, siteMonitoringIssue |
_id |
Read-only. Set on a task Trialflare added for a query or site monitoring issue, when the trial's queryTasksEnabled or siteMonitoringTasksEnabled is on; the task then follows that record to the completed lane and back. |
status |
pending, completed |
Moving a task into the lane marked isCompleteLane completes it, and moving it out sets it back to pending, unless status is sent with the move. |
assignees |
list of user _ids |
Who is responsible. They are notified. Each must have access to the trial (and, when set by someone with site.writeTasks only, be on the staff of one of the task's sites they hold it on). |
sites |
list of site _ids |
The sites the task is for. Empty for a task only trial-wide readers see. |
dueDate |
datetime | null for none. |
Lane fields
| Field | Type | Notes |
|---|---|---|
name |
string | |
description |
string | |
index |
integer | Position on the board. |
isCompleteLane |
boolean | Tasks moved here count as done. |