Toggle menu

closeCase

Closes an open case. 

Normally a case can only be closed if there are no active tasks, unless the active task is configured as "cancelable", in which case it will be cancelled before the case is closed. However, if you use the API and only supply the business key, the case will always be closed, even if there are outstanding tasks that wouldn't normally be cancelable. If you want task limits to be respected, and cases not closed that have tasks that must be completed, you must also supply the user details of a valid case manager.

If the closure reason is not supplied or it does not match any that are pre-configured in the case, then the case default is used, as specified in the case configuration.

Namespace

goss.CaseManagement.v1.api.closeCase

Worker

serverlibrary

Parameters

Required PropertiesTypeDescription
caseBusinessKeyString <businessKey>The business key of the case
Optional PropertiesTypeDescription
closureDateString <ISO 8601 date time>The close date (formatted YYYY-MM-DDTHH:mm:ss.sssZ), will default to "now" if not set
closureNotesStringA note that will be added to the case history and the close case email that gets sent to the person who raised the case
closureReasonStringThe close reason
debugBooleanDefault: false. Set true to return debug information ("notes") in the response message
dryRunBooleanPerforms a dry run
forceCloseBooleanIf true the case will be closed even if there are outstanding tasks that cannot be cancelled
userObjectThe siteUserId and siteUserName of a case manager with permission to close the case. If not supplied the default system user will be used, which automatically enables forceClose

Example

See Case Management API for a full example call.

{
    "caseBusinessKey": "9196-8399-9049-1473",
    "closureReason": "default",
    "closureNotes": "This is a test",
    "user": {
        "siteUserId": 9,
        "siteUserName": "TIMG"
    }
}

Responses

Success

{
    "jsonrpc": "2.0",
    "id": 207,
    "result": {
        "success": true,
        "notes": ["Closure request sent to case 8895-4890-0231-7127", "Case has received closure request"]
    }
}

Error

In this case the business key didn't exist.

{
    "jsonrpc": "2.0",
    "id": 206,
    "result": {
        "success": false,
        "errors": ["CM error: Couldn't find any active executions."]
    }
}

Last modified on June 12, 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon