find tasks
API Support | Available since | Last updated | Output |
---|---|---|---|
5.3001 | 6.0000 | xml, json |
Description
Load a list of non-archived tasks using filter parameters. The last comment in the task must match all filter parameters. The tasks with the most recent last comment are returned first.
This service performs the same as Service: /tasks/find [GET] but returns any tasks that {member}
has access to.
@status
, @priority
, @due
attributes and <assignedto>
element might not be included if comments=first
or none
and the last comment in the task is not loaded.Performance
The performance of this service declines as the number of task or workflow comments increases.
So when you have a large number of tasks or workflows, you might need to consider an alternative such as using an index search which includes the filter pssubtype:task
or pssubtype:workflow
.
The main differences with this service is that the index:
- Is updated asynchronously after a task is created or updated.
- Returns search results that include less data fields than the corresponding objects.
- Does not return results from workflows on archived documents as these are not indexed.
If using the index isn’t possible, you can do the following:
- If you don’t need the contents of the comment, consider using
contents=none
. - If you don’t need the attachments, consider using
attachments=none
. - Use the
createdafter
orpagesize
parameters to reduce the number of results.
Parameters
Name | Description | Required | Type | Default |
---|---|---|---|---|
assignedafter | The date time after which the tasks were assigned last, format is ISO-8601 e.g. 2010-10-25T12:26:00+10:00 | no | datetime | |
assignedbefore | The date time before which the tasks were assigned last, format is ISO-8601 e.g. 2011-08-25T10:20:00-04:00 | no | datetime | |
assignedto | The ID of the member the tasks are assigned to (0 means Nobody) | no | long | |
attachments | The attachments to include (can be none , context , all ) | no | enum | all |
author | The ID of the tasks author | no | long | |
comments | Which comments should be loaded for each task (can be: none , first , last , all , archive ) | no | enum | last |
contents | The contents to include (can be none , all ) | no | enum | all |
contentrole | The contentrole for the tasks, can be comment , workflow , all (comment includes file attachment ) | no | enum | all |
context | The context for the tasks (can be group , uri , all ) | no | enum | all |
createdafter | The date time after which the tasks were created, format is ISO-8601 e.g. 2010-10-25T12:26:00+10:00 | no | datetime | |
createdbefore | The date time before which the tasks were created, format is ISO-8601 e.g. 2011-08-25T10:20:00-04:00 | no | datetime | |
dueafter | The date time after which the tasks are due, format is ISO-8601 e.g. 2010-10-25T12:26:00+10:00 | no | datetime | |
duebefore | The date time before which the tasks are due format is ISO-8601 e.g. 2011-08-25T10:20:00-04:00 | no | datetime | |
emails | The email addresses to include, can be none , all (admin only) | no | enum | none |
groups | Comma-separated list of groups the tasks MUST belong to (if not specified, the user's current groups are used) | no | string | |
labels | Comma-separated list of label values – task MUST have all (not recommended for filtering large data sets) | no | string | |
modifiedafter | The date time after which the tasks were modified, format is ISO-8601 e.g. 2010-10-25T12:26:00+10:00 | no | string | |
page | The page to load | no | integer | 1 |
pagesize | The number of results per page | no | integer | 1000 |
paths | The context URI paths for the tasks - MUST be URL encoded (comma-separated list with optional * suffix) | no | string | |
priorities | Comma-separated list of priorities | no | string | |
project | Return only tasks from the current user’s groups that are under this project (only if groups not specified) | no | string | |
publicationid | Return only tasks for documents in this publication. Requires PageSeeder 5.9907 or higher. | no | publicationid | |
statuses | Comma-separated list of statuses | no | string | |
tasksize | The maximum number of comments to return per task (0 = unlimited) | no | integer | 100 |
title | The title of the tasks (optional wildcard * suffix, use ** to escape) | no | string | |
type | The type of the tasks (optional wildcard * suffix, use ** to escape) | no | string | |
types | Comma-separated list of the types the task can have (empty string means no type) | no | strings |
Permission
This service can only be invoked by the member or an administrator. If the parameter emails is set to all
, the permission is restricted to administrator only.
The other restriction is that the groups parameter can only list groups that have public access or in which the current user is a guest or higher.
Response
The output has the following format:
<tasks> <task id="123" title="My thread" [replycount="1" lastcommentid="234" lastcommentdate="2012-08-20T14:27:48+10:00"] status="Open" [priority="High"] [due="2012-08-25T18:00:00+10:00"]> <uri id="789"> ... </uri> <locator fragment="2"/> [<assignedto id="34" date="2012-08-20T14:27:48+10:00" ...> ... </assignedto>] <comment id="234" contentrole="File Attachment" created="2012-08-20T14:27:48+10:00"> <title>My thread</title> <content type="text/plain">Some text</content> <attachment> <uri id="189"> ... </uri> </attachment> <attachment fragment="5"> <uri id="289"> ... </uri> </attachment> </comment> </task> <task id="100"> ... </task> </tasks>
The @replycount
, @lastcommentid
and @lastcommentdate
are only included and @title
is from the last comment, if the comments
parameter is last
, all
or archive
, otherwise @title
is from the first comment.
Error Handling
Code | Cause / Description |
---|---|
0x1306 | The Group is invalid or not accessible |
0x1312 | The createdafter or createdbefore date is invalid |
0x1313 | The author is invalid |