assignTeamsToSituation
A MoogDb v2 method that assigns one or more teams to a Situation. Once successfully run, Moogsoft Onprem marks the Situation as overridden and the Teams Manager Moolet can no longer modify its team assignment. See Teams Manager Moolet for more information.
The method replaces any teams previously assigned to the Situation. You can also use it to deassign all teams from a Situation.
Back to MoogDb V2 API Method Reference.
Request arguments
Method assignTeamsToSituation
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| Number | Yes | Situation ID. |
| JSON List | No, if you specify | A list of team IDs to assign to the Situation. Specify an empty list to deassign all teams from the Situation. |
| JSON List | No, if you specify | A list of team names to assign to the Situation. Specify an empty list to deassign all teams from the Situation. |
Response
Method assignTeamsToSituation
returns the following response:
Type | Description |
---|---|
JSON Object | A Javascript object containing a list of the team names or team IDs assigned to the Situation, depending on the input. |
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 assignTeamsToSituation
:
Example assigning team IDs to Situation
Example request to assign team IDs 1 and 2 to Situation ID 1:
var assignTeamIDs = moogdb.assignTeamsToSituation(1, { "team_ids" : [1, 2] } )
Example response returning that team IDs 1 and 2 have successfully been assigned to the Situation:
{ "team_ids" : [1, 2] }
Example assigning team names to Situation
Example request to assign teams Team1 and Team2 to Situation ID 1:
var assignTeamNames = moogdb.assignTeamsToSituation(2, { "team_names" : [ "Team1", "Team2" ] } )
Example response returning that teams Team1 and Team2 have successfully been assigned to the Situation:
{ "team_names" : [ "Team1", "Team2" ] }
Example unassigning all teams from a Situation
Example request to unassign all teams from Situation ID 1:
var unassignTeamIDs = moogdb.assignTeamsToSituation(1, { "team_ids" : [] } )
Example response returning that all teams have successfully been unassigned from the Situation:
{ "team_ids" : [] }