-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathCreateServiceNowTemplate.ts
More file actions
37 lines (33 loc) · 1.07 KB
/
CreateServiceNowTemplate.ts
File metadata and controls
37 lines (33 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* Create ServiceNow template returns "Created" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.ServiceNowIntegrationApi(configuration);
const params: v2.ServiceNowIntegrationApiCreateServiceNowTemplateRequest = {
body: {
data: {
attributes: {
assignmentGroupId: "65b3341b-0680-47f9-a6d4-134db45c603e",
businessServiceId: "65b3341b-0680-47f9-a6d4-134db45c603e",
fieldsMapping: {
category: "software",
priority: "1",
},
handleName: "incident-template",
instanceId: "65b3341b-0680-47f9-a6d4-134db45c603e",
servicenowTablename: "incident",
userId: "65b3341b-0680-47f9-a6d4-134db45c603e",
},
type: "servicenow_templates",
},
},
};
apiInstance
.createServiceNowTemplate(params)
.then((data: v2.ServiceNowTemplateResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));