Reset a To-Do
PUT /api/sync/v1/todos/reset
Operation id: resetTodo
Description
This API allows to reset a status of the assignments of the to-do. The assignments with specific status only are allowed to be reset. The assignments with status READ or COMPLETED can be reset. Assignments which are NEW, EXPIRED or OVERDUE cannot be reset.
The user can pass just the taskId and mention the process as RESET which will reset all the eligible assignments for that to-do. If specific assignments need to be reset, a list of assignment ids need to be passed along with to-do Id. The assignment IDs for a to-do can be fetched from GET ASSIGNMENT LIST API.
creatorReason is an optional parameter and assigneeReason parameter can also be ignored.
ReasonTypeId is a required field and supports the following values: [7 for Error in Execution, 8 for To-Do Incomplete or 9 for Other]
Permission Required:
- Creator of the to-do
Tags: To-Do Recall/Reset APIs
Security
- Bearer (http / bearer)
- enter the client service token value.
Responses
200 — Todo Reset Successfully
Content type: application/json
400 — Bad Request
401 — Unauthorized Access
403 — Forbidden
404 — To-Do Not Found
412 — Precondition Failed
500 — Internal Server Error
Request body
Required: Yes
application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
taskId | integer (int32) | Yes | identifier of task for which Reset/Recall is to be done |
process | string | Yes | task process |
creatorReason | string | No | creator reason for reset/recall the task. |
assigneeReason | string | No | assignee reason for reset/recall the task. |
reasonTypeId | integer (int32) | No | specifies the selectable reasons type Ids. |
assignmentIds | array | No | list of Assignments to be reset/recall. |
{
"type": "object",
"required": [
"process",
"taskId"
],
"properties": {
"taskId": {
"type": "integer",
"format": "int32",
"description": "identifier of task for which Reset/Recall is to be done",
"example": 1
},
"process": {
"type": "string",
"description": "task process",
"enum": [
"CREATE",
"APPROVAL",
"EXECUTION",
"TASK_EDIT",
"REJECT",
"RECALL",
"RESET",
"SURVEY_ANSWER_REFUSAL"
],
"example": "RECALL"
},
"creatorReason": {
"type": "string",
"description": "creator reason for reset/recall the task."
},
"assigneeReason": {
"type": "string",
"description": "assignee reason for reset/recall the task."
},
"reasonTypeId": {
"type": "integer",
"format": "int32",
"description": "specifies the selectable reasons type Ids.",
"items": {
"type": "integer",
"example": [
{
"Reset": {
"7-Error in Execution": null,
"8-Task Incomplete": null,
"9-Other": null
}
},
{
"Recall": {
"4-Not Applicable": null,
"5-Duplicate Task": null,
"6-No longer Required": null,
"12-Other": null
}
}
]
}
},
"assignmentIds": {
"type": "array",
"description": "list of Assignments to be reset/recall.",
"example": [
1,
2
],
"items": {
"type": "integer",
"format": "int32",
"description": "list of Assignments"
}
}
}
}
Response models
200 — Todo Reset Successfully
Content type: application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
message | string | No | |
status | string | No | |
statusCode | integer (int32) | No | |
debugErrorMessage | string | No | |
messageCode | string | No | message codes |
messageParams | array | No | |
data | object | No |
{
"type": "object",
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"SUCCESS",
"FAIL",
"BAD_REQUEST",
"NO_CONTENT",
"UNAUTHORIZED",
"FORBIDDEN",
"NOT_FOUND",
"INTERNAL_SERVER_ERROR",
"UNSUPPORTED_MEDIA_TYPE"
]
},
"statusCode": {
"type": "integer",
"format": "int32"
},
"debugErrorMessage": {
"type": "string"
},
"messageCode": {
"type": "string",
"description": "message codes",
"items": {
"type": "string",
"example": [
"ERROR12-To-Do has expired.",
"ERROR13-To-Do has been recalled.",
"ERROR14-Complete all checklist items.",
"ERROR15-Error updating status.",
"ERROR16-Error fetching assignment.",
"ERROR55-Error updating status.",
"ERROR59-To-do is already completed by {name}",
"ERROR75-To-Do has been Recalled.",
"ERROR17-To-Do can not be reassigned as it has been completed.",
"ERROR18-This To-Do is confidential and can not be reassigned.",
"ERROR19-Error while reassigning.",
"ERROR36-Current assignee's site id doesn't match",
"ERROR20-This To-Do can not be recalled as it has not been launched.",
"ERROR21-Error while recalling To-Do.",
"ERROR35-Please select a reason type while recalling a task",
"ERROR58-To-do can not be recalled."
]
}
},
"messageParams": {
"type": "array",
"items": {
"type": "string"
}
},
"data": {
"type": "object"
}
}
}