Incident API
The AlertFind Incident API allows you to perform external operations on the Incident template and Incidents. It enables you to:
- Find a list of Incident templates based on your search criteria.
- Open an Incident based on an already created Incident template.
- (Optional) Override the message content of an Incident template task.
In the previous releases of AlertFind, opening an incident was done using the Notification API (via the sendScenario
method). While this method is usable in the Notification API, it is now deprecated.
Classes included in the Incident API include:
AlertFindIncidentService
NotificationTask
SearchConstraintUI
IncidentTemplateSearchOptions
IncidentTemplate
AlertFindIncident
The AlertFindIncident
class includes the following methods:
openIncidentByQuickLaunchID
openIncidentByTemplateID
findTemplate
countTemplate
openIncidentByQuickLaunchID
The openIncidentByQuickLaunchID
method launches an incident based on the given quick launch ID. A user can optionally specify a list of notification tasks to this method, which defines any overrides to the subject and/or body of a NotificationTask
defined for the Incident. Overrides can specify a new subject, and new body, or both. These overrides are only for the specific incident being launched and will not be applied to the incident template itself.
For this to work, overriding tasks must specify the correct NotificationTask
ID to override. Also, note that overrides can only be specified in the default language of the API user.
The syntax of the openIncidentByQuickLaunchID
method is:
public void openIncidentByQuickLaunchID (
String quickLaunchID,
NotificationTask[] overrides
)
where:
quickLaunchID
is the launch ID of the incident to be launched.overrides
is an array ofNotificationTask
instance. Optionally, it overrides the subject and body of any matchingNotificationTask
defined in the incident template.
openIncidentByTemplateID
The openIncidentByTemplateID
method launches an incident based on the given Incident template ID. A user can optionally specify a list of NotificationTasks
to this method, which defines any overrides to the subject and/or body of a Notification Task defined for the Incident. Overrides can specify a new subject, and new body, or both. These overrides are only for the specific incident being launched and will not be applied to the incident template itself.
For this to work, overriding tasks must specify the correct NotificationTask
ID to override. Also, note that overrides can only be specified in the default language of the API user.
The syntax of the openIncidentByTemplateID
method is:
public long openIncidentByTemplateID (
Long templateID,
NotificationTask[] overrides
)
where:
templateID
is the incident template ID of the incident to be launched.overrides
is an array ofNotificationTask
instance. Optionally, it overrides the subject and body of any matchingNotificationTask
defined in the incident template.
findTemplate
The findTemplate
method retrieves a list of Incident templates based on a search criteria. It accepts a single parameter options
that defines the search criteria. If the parameter options
is defined, results are scoped on the role of the API user. Following are the various criteria options available:
teamName
searches for incident templates on this team. If undefined, results are scoped based on the role of the API user.includeSubTeams
includes sub-teams in the search ifteamName
is defined. If undefined, defaults to a value offalse
.id
retrieves a specific incident template by ID.name
retrieves a specific incident template by name.
The syntax of the findTemplate
method is:
public IncidentTemplate[] findTemplate (
final IncidentTemplateSearchOptions options
) throws PermissionDeniedException,
InvalidArgumentException;
where:
options
is a specific search criteria.
Results of the this method are scoped based on the security model, which takes into account the specific role of the API user. Following are the results of querying findTemplate
method:
- As an administrator, you can access all incident templates defined in the customer's instance.
- A team leader can access all Incident templates defined in his or her team and sub-teams.
- A normal user do not have access to incident templates, and cannot retrieve results.
countTemplate
The countTemplate
counts the number of Incident Templates based on a search criteria.
The syntax of the openIncidentByTemplateID
method is:
public int openIncidentByTemplateID (
final IncidentTemplateSearchOptions options
) throws PermissionDeniedException,
InvalidArgumentException;
where:
IncidentTemplateSearchOptions
is the specific search criteria option.
NotificationTask
The NotificationTask
object used in the AlertFindIncident
class provides a list of notification tasks.
The syntax of the NotificationTask
class is:
public void NotificationTask {
Long id,
String subject,
String body
}
where:
id
is the notification task ID.subject
is the subject of the notification.body
is the body of the notification.
SearchConstraintUI
The SearchConstraintUI
class object used in the AlertFindIncident
class allows you to edit the search criteria to filter and find a list of incident templates based on the criteria set.
The syntax of the SearchConstraintUI
class is:
public void SearchConstraintUI (
String operator,
String property,
String value
)
where:
operator
provides a list of filtering options.property
is the custom field name.value
is the value to be used along with the filtering option to sort the incident templates.
IncidentTemplateSearchOptions
The IncidentTemplateSearchOptions
class opens an incident template based on a search criteria.
The syntax of the IncidentTemplateSearchOptions
class is:
public void IncidentTemplateSearchOptions {
Boolean isShowSubTeamIncidentTemplates;
String teamName;
String[] sort;
Integer start;
Integer limit;
SearchConstraintUI[] constraints;
}
where:
isShowSubTeamIncidentTemplates
includes sub-teams incident templates in the search ifteamName
is defined. If undefined, defaults to a value offalse
.teamName
searches for incident templates on this team. If undefined, results are scoped based on the role of the API user.sort
is an array ofString
. It sorts the incident templates based on the search criteria.start
starts the sorting of templates.limit
narrows the search constraint to refine the list of incident templates displayed.constraints
is an array ofSearchConstraintUI
array. It is the filtering option to be used for searching the template.
IncidentTemplate
The IncidentTemplate
object used in the AlertFindIncident
class opens an Incident based on an already created Incident template.
The syntax of the IncidentTemplate
class is:
public void IncidentTemplate {
long id;
String name;
String description;
String quickLaunchId;
String teamName;
NotificationTask[] notificationTasks;
}
where:
id
is the incident template ID.name
is the name of the incident template.description
is the description of the incident template.quickLaunchId
is the quick launch ID of the incident template to be launched.teamName
searches for incident templates on this team. If undefined, results are scoped based on the role of the API user.notificationTasks
is an array ofNotificationTask
.