Associating a Report to an Incident Category (Report Flag)
To associate a Report to an Incident Category (Report Flag), the Report’s Template Fields list needs to have one field defined for holding Incident Category data. Then when you create the Report Fields data of a new Report, you can populate the value of that Incident Category field with the ID number of the /report-flags record that holds the definition of the Incident Category.
E.g.
POST /report-template-fields
{
"parent": {
"type": "report-templates",
"object": 1212
},
"label": "incident category",
"type": "LIST_FLAG",
"required": false,
"adminOnly": false,
"displayOrder": 0,
"isDispatcherField": false,
"confidential": false
}Once your Report Template has a field to hold an Incident Category, when the integration is creating a new report , it can add the ID of the Incident Category as a value for that field.
E.g.
POST /reports
{
"reportTemplate": 1212,
"account": 688,
"reportFields": {
"402": "Main body of text",
"1211": 600
}
} 402 and 1211 are the IDs of report-template-fields records, and the 600 is the Incident Category.
GET /report-flags/600
{
"id": 600,
"name": "A special event",
"details": "",
"showInDefaultGroup": true,
"severityLevel": "SEVERE",
"customId": "EventCode-01",
"category": 601,
"alias": null,
"isGlobal": true,
"isAvailableInSubRegion": true,
"region": 252,
"reportFlagTemplate": null,
"defaultLanguage": "",
"translatable": false
}Moving a Report Between Incident Categories
Reports that have an Incident Category type Report Field in it, will be visible as a report in that Incident Category. Should you associate it by mistake and need to move it to a new category (report-flag), you need to PATCH the Report, and the system will auto-rewrite the Report Field that contains the ID of the report-flag.
Here’s an example of updating a Report that previous belonged under Incident Category 25, so that it becomes 24:
[PATCH] /reports/4218
{
"reportFields": [
{"field": 1931, "value": "24"}
]
}24 = report-flag
1931 = report-template-field (of the report-template that the report is based on)