SetTaskComment API¶
Sets the user comment on a workflow task. The comment is stored with the task and visible to supervisors and other users with access to the workflow.
Pass an empty string to clear an existing comment.
Endpoint¶
Methods¶
- GET
/srv.asmx/SetTaskComment?authenticationTicket=...&taskId=...&comments=... - POST
/srv.asmx/SetTaskComment(form data) - SOAP Action:
http://tempuri.org/SetTaskComment
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
authenticationTicket |
string | Yes | Authentication ticket obtained from AuthenticateUser. |
taskId |
integer | Yes | Unique numeric ID of the task. |
comments |
string | Yes | Comment text for the task. Pass an empty string to clear the comment. Any length is kept; task lists show the first 255 characters. |
Response¶
Success Response¶
Error Response¶
Required Permissions¶
The calling user must be the current task assignee.
Anonymous access is not permitted.
Eligible Task States¶
The task must be in one of the following states:
| Status | Allowed |
|---|---|
InProgress |
Yes |
DueDateChanged |
Yes |
NotStarted |
No |
Completed |
No |
Dropped |
No |
Reassigned |
No |
Example¶
GET Request¶
GET /srv.asmx/SetTaskComment
?authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
&taskId=4812
&comments=Reviewed+the+document.+All+sections+look+correct.
HTTP/1.1
Host: yourserver
POST Request¶
POST /srv.asmx/SetTaskComment HTTP/1.1
Host: yourserver
Content-Type: application/x-www-form-urlencoded
authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c&taskId=4812&comments=Reviewed+the+document.+All+sections+look+correct.
JavaScript¶
Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and
errorCode is the number to report.
async function call(action, params) {
const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
const root = new DOMParser()
.parseFromString(await response.text(), 'text/xml')
.documentElement;
if (root.getAttribute('success') !== 'true') {
throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
}
return root;
}
Replaces the assignee's comment on a task.
await call('SetTaskComment', {
authenticationTicket: ticket,
taskId: 7328,
comments: 'Checked against the purchase order.'
});
comments is a required string: an empty one is refused by model binding with HTTP 400.
Notes¶
- Comments are stored in two places: a database field (truncated to 255 characters) and a warehouse XML file (full length). Retrieving the task via GetTask returns the full-length comment from the warehouse.
- Setting a comment does not complete the task. Call CompleteTask to advance the workflow.
- The associated document must not be in an offline state.
- Line endings in the
commentsparameter are normalized before storage.
Related APIs¶
- GetTask -" Get full details of a task including its current comment.
- CompleteTask -" Mark a task as completed and advance the workflow.
- SetTaskApprovalStatus -" Set the approval decision on a task.
- SetTaskPriority -" Set the priority of a task.
Error Codes¶
The errorCode values this operation returns, checked against a running server:
errorCode |
When |
|---|---|
4010 |
the ticket is expired or unknown |
4000 |
no task by that id, or the caller may not comment on it |
4030 |
there is no ticket at all |
HTTP 400 |
a required string parameter was empty; refused by model binding, so there is no error document |