@manyos/smileconnect-api 1.30.0 → 1.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,6 +4,8 @@ const log = require('@manyos/logger').setupLog('SMILEconnect_' + path.basename(_
|
|
|
4
4
|
const orgdata = require('../controller/orgdataController');
|
|
5
5
|
const cmdbObjectController = require('../controller/cmdbobjectController');
|
|
6
6
|
const ticketCiRelation = require('./ticketCIRelationController');
|
|
7
|
+
const ticketController = require('./ticketController');
|
|
8
|
+
const config = require('../util/config');
|
|
7
9
|
|
|
8
10
|
async function getRelatedObjects(req, res, next) {
|
|
9
11
|
log.debug('include Data', req.includeArray);
|
|
@@ -85,7 +87,8 @@ async function getRelatedObjects(req, res, next) {
|
|
|
85
87
|
for (x=0; x < incidentArray.length; x++) {
|
|
86
88
|
const id = incidentArray[x];
|
|
87
89
|
log.debug('searchIncident', id);
|
|
88
|
-
const
|
|
90
|
+
const ticketConfig = config.ticketConfig["incidents"];
|
|
91
|
+
const result = await ticketController.getTicket(ticketConfig, clientConfig, id);
|
|
89
92
|
if (result && result.data) {
|
|
90
93
|
incidents.push(result.data);
|
|
91
94
|
}
|
|
@@ -100,7 +103,8 @@ async function getRelatedObjects(req, res, next) {
|
|
|
100
103
|
for (x=0; x < ticketIdArray.length; x++) {
|
|
101
104
|
const id = ticketIdArray[x];
|
|
102
105
|
log.debug('searchWorkOrder', id);
|
|
103
|
-
const
|
|
106
|
+
const ticketConfig = config.ticketConfig["workorders"];
|
|
107
|
+
const result = await ticketController.getTicket(ticketConfig, clientConfig, id);
|
|
104
108
|
if (result && result.data) {
|
|
105
109
|
tickets.push(result.data);
|
|
106
110
|
}
|
|
@@ -115,7 +119,8 @@ async function getRelatedObjects(req, res, next) {
|
|
|
115
119
|
for (x=0; x < ticketIdArray.length; x++) {
|
|
116
120
|
const id = ticketIdArray[x];
|
|
117
121
|
log.debug('searchProblem', id);
|
|
118
|
-
const
|
|
122
|
+
const ticketConfig = config.ticketConfig["problems"];
|
|
123
|
+
const result = await ticketController.getTicket(ticketConfig, clientConfig, id);
|
|
119
124
|
if (result && result.data) {
|
|
120
125
|
tickets.push(result.data);
|
|
121
126
|
}
|
|
@@ -130,7 +135,8 @@ async function getRelatedObjects(req, res, next) {
|
|
|
130
135
|
for (x=0; x < ticketIdArray.length; x++) {
|
|
131
136
|
const id = ticketIdArray[x];
|
|
132
137
|
log.debug('searchChange', id);
|
|
133
|
-
const
|
|
138
|
+
const ticketConfig = config.ticketConfig["changes"];
|
|
139
|
+
const result = await ticketController.getTicket(ticketConfig, clientConfig, id);
|
|
134
140
|
if (result && result.data) {
|
|
135
141
|
tickets.push(result.data);
|
|
136
142
|
}
|