Toggle menu

Bulk Closing Cases

The closeResolvedCases utility End Point closes cases based on the length of time they have spent at a particular status with no activity recorded against the case. It can perform a dry run of the close operation and send a report of the cases that were/could be closed to one or more recipients.

Configuration

Before using this tool you'll need to set up its configuration rules.

The rules for the close case utility should be placed in an End Point at config.<environment>.closeResolvedCases.getConfig. There's an example that can be copied at config.example.closeResolvedCases.getConfig

It has the following structure:

function(params, credentials) {
    let config = {
        batchSize: 20,
        maximumRunTime: "PT10M",
        report: {
            to: [{
                name: "The support team",
                address: "support@my-website.com"
            }]
        },
        rules: [{
                caseType: "feedback",
                ignoreClosureRules: true,
                closeCriteria: [{
                    status: "*",
                    statusDuration: "P3W",
                    closureReason: "Automatic",
                    closureNotes: "Automatically closed"
                }]
            },
            {
                caseType: "complaint",
                ignoreClosureRules: false,
                closeCriteria: [{
                    status: "On hold",
                    statusDuration: "P2W"
                },{
                    status: "With client",
                    statusDuration: "P1W"
                }]
            }
        ]
    };
    return config;
}

Where:

PropertyDescription
batchSizeThe number of cases to process in a batch. We recommend between 20-50
maximumRuntimeAn ISO8601 duration string that sets how long the end point will continue to process the rules. If this time is exceeded the end point will complete processing the current batch and then terminate
report.toAn array of objects where each sets the name and email address of a recipient
rulesAn array of object rules where:
rules[n].caseTypeThis is the case type ID the rules will apply to
rules[n].ignoreClosureRulesIf set as true, the case will be force closed even if it has outstanding tasks
rules[n].caseType.closeCriteriaAn array of criteria to consider for this case type
rules[n].caseType.closeCriteria[n].statusThe case status to test. An asterisk "*" will test against any status
rules[n].caseType.closeCriteria[n].statusDurationAn ISO8601 duration string. Cases that have exceeded this time spent at the named status with no activity logged against them will be closed. The End Point determines "activity" by looking for the timestamp of the last note added to the case, including system notes
rules[n].caseType.closeCriteria[n].closureReasonA close reason to record in the case history
rules[n].caseType.closeCriteria[n].closureNotesA close note to add to the case history

In the examples above:

  • any feedback cases that have been inactive and spent more than three weeks at their current status (whatever that status is) would be closed
  • any complaint cases that have been inactive and either on hold for over two weeks or with client for one week would be closed

Running the End Point

The goss.CaseManagement.v1.core.utils.closeResolvedCases.closeResolvedCases End Point can either be used manually or run on a schedule.

Dry Run

If you run the End Point using the testing tab in iCM, set the dryRun parameters as true:

{
    "dryRun": true
}

This will email a report to the users named in the configuration without closing any cases. The email includes a list of the cases that would be closed and those that would fail to close (because they may have outstanding tasks etc).

Scheduling

When scheduling the End Point, pass in the {"_async":{}} parameter:

Scheduled Close Case End Point
 

The End Point would normally be set to run daily or weekly, depending on the number of cases you suspect may be dormant. Each time it runs it will check the rules set in your configuration End Point and attempt to close any cases that meet the close criteria.

Last modified on 31 October 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon