Post Task Comment
Creates a comment for a task by id.
Method
POST /task/{id}/comment/create
Parameters
Path Parameters
Name | Description |
---|---|
id | The id of the task to add the comment to. |
Request Body
A JSON object with the following properties:
Name | Description |
---|---|
message | The message of the task comment to create. Has to be of type String . |
processInstanceId | Assigns the comment to a process instance id. |
Result
A JSON object representing the newly created comment. Its structure corresponds to the Comment
interface in the engine.
Its properties are as follows:
Name | Type | Description |
---|---|---|
id | String | The id of the task comment. |
userId | String | The id of the user who created the comment. |
taskId | String | The id of the task to which the comment belongs. |
processInstanceId | String | The id of the process instance the comment is related to. |
time | Date | The time when the comment was created. |
message | String | The content of the comment. |
links | List | Link to the newly created task comment with method , href and rel . |
removalTime | String | The time after which the comment should be removed by the History Cleanup job. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ . |
rootProcessInstanceId | String | The process instance id of the root process instance that initiated the process containing the task. |
Response Codes
Code | Media type | Description |
---|---|---|
200 | application/json | Request successful. |
400 | application/json | The task does not exist or no comment message was submitted. See the Introduction for the error response format. |
403 | application/json | The history of the engine is disabled. See the Introduction for the error response format. |
Example
Request
Post data for a new task comment:
POST /task/aTaskId/comment/create
{
"message": "a task comment",
"processInstanceId": "96dc383f-23eb-11e6-8e4a-f6aefe19b687"
}
Response
Status 200.
{
"links": [
{
"method": "GET",
"href": "http://localhost:38080/rest-test/task/aTaskId/comment/aTaskCommentId",
"rel": "self"
}
],
"id": "aTaskCommentId",
"userId": "userId",
"taskId": "aTaskId",
"processInstanceId": "96dc383f-23eb-11e6-8e4a-f6aefe19b687",
"time": "2013-01-02T21:37:03.887+0200",
"message": "comment message",
"removalTime":"2018-02-10T14:33:19.000+0200",
"rootProcessInstanceId": "aRootProcessInstanceId"
}