Skip to main content

updateClosedSituation

A MoogDb v2 method that updates the description and custom info of a closed Situation during the grace period. The grace period is when a Situation is closed and in the active database, before it is archived to the historic database. If a custom info field already exists, this method replaces the previous value; if a custom info field does not exist, this method adds it.

The updateClosedSituation method returns an error if the Situation is open, or if it is closed and has been archived to the historic database.

Back to MoogDb V2 API Method Reference.

Request arguments

Method updateClosedSituation takes the following request arguments:

Name

Type

Required

Description

sitn_id

Number

Yes

ID of the closed Situation that you want to update.

description

String

No

New description of the Situation.

custom_info

JSON Object

No

A JSON object containing the custom info values that you want to update. If the key already exists, the method replaces the existing value. If the key does not exist, the method adds it.

Response

Method updateClosedSituation returns the following response:

API update behavior

The behavior of this method depends on whether the relevant alert or Situation is open, closed and still in the active database, or closed and archived to the historic database. This method updates or returns information about the alert or Situation as follows:

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of method updateClosedSituation:

Request example

Example request to update the description and custom info for Situation ID 333:

function updateClosedSituation1()
{
    var obtainSit=moogdb.getSituation(333);
    var customInfo={"key1":"value1"};
    obtainSit.set("description", "updateClosedSituation1_description_updated");
    obtainSit.set("custom_info", customInfo);
    var result=moogdb.updateClosedSituation(obtainSit);
    logger.warning("system updates Situation which is in grace period, result should return true");
    logger.warning("result = "+ result);
}

Response example