@manyos/smileconnect-api 1.52.3 → 1.53.0
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.
- package/Dockerfile +1 -1
- package/app.js +6 -2
- package/conf/clients.json +2 -1
- package/conf/mapping.json +8 -0
- package/controller/ticketCIRelationController.js +18 -6
- package/controller/ticketController.js +17 -4
- package/docs/releases.md +6 -0
- package/package.json +1 -1
- package/routes/ticketRoutes.js +3 -3
- package/util/config.js +80 -25
package/Dockerfile
CHANGED
package/app.js
CHANGED
|
@@ -184,8 +184,12 @@ app.use('/v1/health', function (req, res, next) {
|
|
|
184
184
|
//health check
|
|
185
185
|
app.use('/v1/openapi/:clientId', async function (req, res, next) {
|
|
186
186
|
const clientId = req.params.clientId;
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
try {
|
|
188
|
+
const spec = await config.getDesignPackage(clientId)
|
|
189
|
+
res.json(spec)
|
|
190
|
+
} catch (error) {
|
|
191
|
+
next(error)
|
|
192
|
+
}
|
|
189
193
|
})
|
|
190
194
|
|
|
191
195
|
const maxFilesize = process.env.MAX_FILESIZE || 5;
|
package/conf/clients.json
CHANGED
package/conf/mapping.json
CHANGED
|
@@ -157,6 +157,10 @@
|
|
|
157
157
|
{
|
|
158
158
|
"oldName": "Change Target Date",
|
|
159
159
|
"newName": "changeTargetDate"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"oldName": "ServiceCI_ReconID",
|
|
163
|
+
"newName": "serviceReconId"
|
|
160
164
|
}
|
|
161
165
|
],
|
|
162
166
|
"person": [
|
|
@@ -237,6 +241,10 @@
|
|
|
237
241
|
{
|
|
238
242
|
"oldName": "Detailed Description",
|
|
239
243
|
"newName": "detailedDescription"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"oldName": "ServiceCI_ReconID",
|
|
247
|
+
"newName": "serviceReconId"
|
|
240
248
|
}
|
|
241
249
|
],
|
|
242
250
|
"changeWorklog": [
|
|
@@ -394,12 +394,23 @@ async function getOppositeAssocTypeByCode(assocCode) {
|
|
|
394
394
|
});
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
function doesCIRelationExists(ticketRelations, newRelation) {
|
|
397
|
+
function doesCIRelationExists(ticketRelations, newRelation, keepCIs) {
|
|
398
398
|
log.debug('check for relation old', ticketRelations)
|
|
399
399
|
log.debug('check for relation new', newRelation)
|
|
400
400
|
const relationFound = ticketRelations.find(relation => {
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
let found = (relation.ciId === newRelation.ciId || relation.ciId === newRelation.ciReconId || relation.ciReconId === newRelation.ciId) && relation.relationType === newRelation.relationType
|
|
402
|
+
//check keepCIs only if not found
|
|
403
|
+
log.debug('relation found', found)
|
|
404
|
+
if (!found && keepCIs && Array.isArray(keepCIs)) {
|
|
405
|
+
log.debug('keep CI check', keepCIs)
|
|
406
|
+
keepCIs.forEach(keepCI => {
|
|
407
|
+
if (newRelation.ciId === keepCI || newRelation.ciReconId === keepCI) {
|
|
408
|
+
found = true
|
|
409
|
+
log.debug('Relation found in Keep', keepCI, found)
|
|
410
|
+
}
|
|
411
|
+
})
|
|
412
|
+
}
|
|
413
|
+
return found
|
|
403
414
|
});
|
|
404
415
|
if (relationFound) {
|
|
405
416
|
return true;
|
|
@@ -421,6 +432,7 @@ function doesTicketRelationExists(ticketRelations, newRelation) {
|
|
|
421
432
|
}
|
|
422
433
|
|
|
423
434
|
async function updateRelations(ticketConfig, userConfig, ticketId, relations) {
|
|
435
|
+
// Wenn CIs vom Löschen ausgeschlossen werden sollen, dann kann unter relations.keepCIs ein Array mit Recon/InstanceId gesetzt werden.
|
|
424
436
|
log.debug('Checker', {ticketConfig, userConfig, ticketId, relations});
|
|
425
437
|
// Remove Ticket Relations if task
|
|
426
438
|
if (ticketConfig.assocTicketType === 'Task') {
|
|
@@ -436,7 +448,7 @@ async function updateRelations(ticketConfig, userConfig, ticketId, relations) {
|
|
|
436
448
|
if (relations.ciRelations && Array.isArray(relations.ciRelations)) {
|
|
437
449
|
for (x=0; x<relations.ciRelations.length; x++) {
|
|
438
450
|
const relation = relations.ciRelations[x];
|
|
439
|
-
const relationsExists = doesCIRelationExists(existingRelations, relation);
|
|
451
|
+
const relationsExists = doesCIRelationExists(existingRelations, relation, relations.keepCIs);
|
|
440
452
|
log.debug('createRelation, already exists', relation, relationsExists);
|
|
441
453
|
if (!relationsExists) {
|
|
442
454
|
await createTicketCIRelation(ticketConfig, ticketId, relation.ciId, relation.relationType);
|
|
@@ -447,9 +459,9 @@ async function updateRelations(ticketConfig, userConfig, ticketId, relations) {
|
|
|
447
459
|
if (existingRelations && Array.isArray(existingRelations)) {
|
|
448
460
|
for (x=0; x<existingRelations.length; x++) {
|
|
449
461
|
const relation = existingRelations[x];
|
|
450
|
-
const shouldRelationsExists = doesCIRelationExists(relations.ciRelations, relation);
|
|
462
|
+
const shouldRelationsExists = doesCIRelationExists(relations.ciRelations, relation, relations.keepCIs);
|
|
451
463
|
log.debug('deleteRelation, already exists', relation, shouldRelationsExists);
|
|
452
|
-
if (
|
|
464
|
+
if (shouldRelationsExists !== true) {
|
|
453
465
|
await deleteTicketCIRelation(ticketConfig, ticketId, relation.ciId);
|
|
454
466
|
}
|
|
455
467
|
}
|
|
@@ -21,7 +21,7 @@ function getTickets(ticketConfig, config, includeString, customOptions, globalSc
|
|
|
21
21
|
|
|
22
22
|
async function createTicket(ticketConfig, clientConfig, data, globalScriptParams) {
|
|
23
23
|
const scripts = clientConfig[ticketConfig.requestType].scripts.POST;
|
|
24
|
-
|
|
24
|
+
const relations = data.relations || {}
|
|
25
25
|
//run preScripts
|
|
26
26
|
if (scripts && scripts.preMapping) {
|
|
27
27
|
await scriptController.runScripts(scripts.preMapping, data, clientConfig.clientId);
|
|
@@ -51,6 +51,14 @@ async function createTicket(ticketConfig, clientConfig, data, globalScriptParams
|
|
|
51
51
|
if (resultInterfaceCreate.data && Array.isArray(resultInterfaceCreate.data) && resultInterfaceCreate.data.length && resultInterfaceCreate.data[0][ticketConfig.ticketIdField]) {
|
|
52
52
|
const ticketId = resultInterfaceCreate.data[0][ticketConfig.ticketIdField];
|
|
53
53
|
globalScriptParams.id = ticketId
|
|
54
|
+
|
|
55
|
+
//do relation stuff here
|
|
56
|
+
//keep businessService CI Relation
|
|
57
|
+
if (data[ticketConfig.businessServiceReconIdField] && relations) {
|
|
58
|
+
relations.keepCIs = [data[ticketConfig.businessServiceReconIdField]]
|
|
59
|
+
}
|
|
60
|
+
await ticketCIRelationController.updateRelations(ticketConfig, clientConfig, ticketId, relations);
|
|
61
|
+
|
|
54
62
|
} else {
|
|
55
63
|
log.error('Cannot create Ticket', resultInterfaceCreate);
|
|
56
64
|
throw({message: 'Cannot create Ticket', details : resultInterfaceCreate});
|
|
@@ -275,6 +283,7 @@ async function getTicket(ticketConfig, config, id, mapping, includeString, globa
|
|
|
275
283
|
async function updateTicket(ticketConfig, clientConfig, id, ticketData, globalScriptParams) {
|
|
276
284
|
const scripts = clientConfig[ticketConfig.requestType].scripts.PUT;
|
|
277
285
|
const fields = clientConfig[ticketConfig.requestType].fields
|
|
286
|
+
const relations = ticketData.relations || {}
|
|
278
287
|
|
|
279
288
|
//run preScripts
|
|
280
289
|
if (scripts && scripts.preMapping) {
|
|
@@ -283,8 +292,8 @@ async function updateTicket(ticketConfig, clientConfig, id, ticketData, globalSc
|
|
|
283
292
|
|
|
284
293
|
log.debug(clientConfig[ticketConfig.requestType]);
|
|
285
294
|
const myClientConfig = {};
|
|
286
|
-
myClientConfig[ticketConfig.requestType] = {baseQuery: clientConfig[ticketConfig.requestType].baseQuery, fields: [1]};
|
|
287
|
-
const myMapping = [{"oldName":ticketConfig.requestIdField, "newName" : "internalId"}];
|
|
295
|
+
myClientConfig[ticketConfig.requestType] = {baseQuery: clientConfig[ticketConfig.requestType].baseQuery, fields: [1, ticketConfig.businessServiceReconIdField]};
|
|
296
|
+
const myMapping = [{"oldName":ticketConfig.requestIdField, "newName" : "internalId"}, {"oldName":ticketConfig.businessServiceReconIdField, "newName" : "serviceReconId"}];
|
|
288
297
|
|
|
289
298
|
const mapping = config.getMapping(ticketConfig.requestType);
|
|
290
299
|
|
|
@@ -298,9 +307,13 @@ async function updateTicket(ticketConfig, clientConfig, id, ticketData, globalSc
|
|
|
298
307
|
|
|
299
308
|
const ticket = await getTicket(ticketConfig, myClientConfig, id, myMapping, undefined, globalScriptParams);
|
|
300
309
|
log.debug('Ticket to Update', ticket);
|
|
310
|
+
//keep businessService CI Relation
|
|
311
|
+
if (ticket && ticket.data && ticket.data.serviceReconId && relations) {
|
|
312
|
+
relations.keepCIs = [ticket.data.serviceReconId]
|
|
313
|
+
}
|
|
301
314
|
//todo Abfangen wenn getTicket nichts liefert.
|
|
302
315
|
const update = await arquery.updateEntry(ticketConfig.forms.regular, ticket.data.internalId, ticketData);
|
|
303
|
-
|
|
316
|
+
await ticketCIRelationController.updateRelations(ticketConfig, clientConfig, id, relations);
|
|
304
317
|
//run afterExecution
|
|
305
318
|
if (scripts && scripts.afterExecution) {
|
|
306
319
|
await scriptController.runScripts(scripts.afterExecution, ticketData, clientConfig.clientId, globalScriptParams);
|
package/docs/releases.md
CHANGED
package/package.json
CHANGED
package/routes/ticketRoutes.js
CHANGED
|
@@ -62,12 +62,12 @@ module.exports = (function() {
|
|
|
62
62
|
req.errorStatus = 422;
|
|
63
63
|
next(errors.array());
|
|
64
64
|
} else {
|
|
65
|
-
const relations = req.body.data.relations;
|
|
65
|
+
//const relations = req.body.data.relations;
|
|
66
66
|
ticketController.createTicket(req.ticketConfig, req.user.config, req.body.data, req.globalScriptParams).then(async function (createResult) {
|
|
67
67
|
const ticketId = createResult.data[0][req.ticketConfig.ticketIdField];
|
|
68
68
|
eventLog.setTicketId(req, ticketId);
|
|
69
69
|
req.eventData.ticketNumber = ticketId;
|
|
70
|
-
await ticketCIRelationController.updateRelations(req.ticketConfig, req.user.config, ticketId, relations);
|
|
70
|
+
//await ticketCIRelationController.updateRelations(req.ticketConfig, req.user.config, ticketId, relations);
|
|
71
71
|
getTicket(req, res, next, req.user.config, ticketId, null, includeString);
|
|
72
72
|
}).catch(function (reason) {
|
|
73
73
|
next(reason);
|
|
@@ -171,7 +171,7 @@ module.exports = (function() {
|
|
|
171
171
|
const relations = req.body.data.relations;
|
|
172
172
|
ticketController.updateTicket(req.ticketConfig, req.user.config, id, req.body.data, req.globalScriptParams)
|
|
173
173
|
.then(async function (updateResult) {
|
|
174
|
-
await ticketCIRelationController.updateRelations(req.ticketConfig, req.user.config, id, relations);
|
|
174
|
+
//await ticketCIRelationController.updateRelations(req.ticketConfig, req.user.config, id, relations);
|
|
175
175
|
getTicket(req, res, next, req.user.config, id, null, includeString);
|
|
176
176
|
}).catch(function (reason) {
|
|
177
177
|
next(reason);
|
package/util/config.js
CHANGED
|
@@ -330,28 +330,34 @@ async function getDesignPackage(clientId) {
|
|
|
330
330
|
const clientConfig = await getClientConfig(clientId)
|
|
331
331
|
const schemas = {}
|
|
332
332
|
let paths = {}
|
|
333
|
+
|
|
334
|
+
//generate docs for normal tickets
|
|
333
335
|
const keys = Object.keys(ticketConfig)
|
|
336
|
+
|
|
334
337
|
for (let x=0; x<keys.length; x++) {
|
|
335
338
|
const key = keys[x]
|
|
336
339
|
const config = ticketConfig[key]
|
|
337
340
|
const clientObjectConfig = clientConfig[config.requestType]
|
|
338
341
|
if (clientObjectConfig) {
|
|
339
|
-
{
|
|
342
|
+
if (clientObjectConfig.fields && clientObjectConfig.fields.length > 0){
|
|
340
343
|
const mapping = getDeprecatedMappingAsCustom(config.requestType)
|
|
341
|
-
schemas[config.requestType] = await getObjectSchema(clientObjectConfig, mapping, config.forms.regular)
|
|
344
|
+
schemas[config.requestType] = await getObjectSchema(clientObjectConfig.fields, mapping, config.forms.regular)
|
|
342
345
|
paths = {...paths, ... await getPathDef(config.assocTicketType, config.baseURI, config.requestType)}
|
|
343
346
|
}
|
|
344
|
-
if (config.requestTypeWorkLog) {
|
|
347
|
+
if (config.requestTypeWorkLog && clientConfig[config.requestTypeWorkLog].fields && clientConfig[config.requestTypeWorkLog].fields.length > 0) {
|
|
345
348
|
const mapping = getDeprecatedMappingAsCustom(config.requestTypeWorkLog)
|
|
346
|
-
schemas[config.requestTypeWorkLog] = await getObjectSchema(clientConfig[config.requestTypeWorkLog], mapping, config.forms.workLog)
|
|
349
|
+
schemas[config.requestTypeWorkLog] = await getObjectSchema(clientConfig[config.requestTypeWorkLog].fields, mapping, config.forms.workLog)
|
|
347
350
|
paths = {...paths, ... await getPathDef(config.assocTicketType, config.baseURI + '/{ticketId}/worklogs', config.requestTypeWorkLog, true, true)}
|
|
348
351
|
}
|
|
349
|
-
if (config.requestTemplate) {
|
|
352
|
+
if (config.requestTemplate && clientConfig[config.requestTemplate].fields && clientConfig[config.requestTemplate].fields.length > 0) {
|
|
350
353
|
const mapping = getDeprecatedMappingAsCustom(config.requestTemplate)
|
|
351
|
-
schemas[config.requestTemplate] = await getObjectSchema(clientConfig[config.requestTemplate], mapping, config.forms.template)
|
|
354
|
+
schemas[config.requestTemplate] = await getObjectSchema(clientConfig[config.requestTemplate].fields, mapping, config.forms.template)
|
|
352
355
|
}
|
|
353
356
|
}
|
|
354
357
|
}
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
//generate docs for custom Forms
|
|
355
361
|
const customFormMappings = await getCustomFormMapping()
|
|
356
362
|
const customKeys = Object.keys(customFormMappings)
|
|
357
363
|
for (let x=0; x<customKeys.length; x++) {
|
|
@@ -360,14 +366,51 @@ async function getDesignPackage(clientId) {
|
|
|
360
366
|
const clientObjectConfig = clientConfig[`custom_${formName}`]
|
|
361
367
|
log.debug('key', key, clientObjectConfig)
|
|
362
368
|
if (clientObjectConfig) {
|
|
363
|
-
schemas[key] = await getObjectSchema(clientObjectConfig, customFormMappings[key].mapping, formName)
|
|
369
|
+
schemas[key] = await getObjectSchema(clientObjectConfig.fields, customFormMappings[key].mapping, formName)
|
|
364
370
|
paths = {...paths, ... await getPathDef(key, '/v1/customForms/' + key, key)}
|
|
365
371
|
}
|
|
366
372
|
}
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
//generate docs for cmdb
|
|
376
|
+
const cmdbMapping = getDeprecatedMappingAsCustom('cmdbobject')
|
|
377
|
+
|
|
378
|
+
if (clientConfig.cmdbobject && clientConfig.cmdbobject.fields) {
|
|
379
|
+
schemas['cmdbobject'] = await getObjectSchema(clientConfig.cmdbobject.fields, cmdbMapping, 'AST:BaseElement')
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
const cmdbdef = Object.keys(clientConfig.cmdbobject)
|
|
383
|
+
const classConfigs = cmdbdef.filter(item => item.startsWith('fields_'))
|
|
384
|
+
const cmdbSchemaList = ['cmdbobject']
|
|
385
|
+
for (let x=0; x<classConfigs.length; x++) {
|
|
386
|
+
const classConfig = classConfigs[x]
|
|
387
|
+
const formName = classConfig.replace('fields_', '')
|
|
388
|
+
const fields = clientConfig.cmdbobject[classConfig]
|
|
389
|
+
const classMapping = getDeprecatedMappingAsCustom(`cmdbobject_${formName}`)
|
|
390
|
+
const classSchema = await getObjectSchema(fields, classMapping, formName)
|
|
391
|
+
let schemaName = `cmdbobject_${formName}`
|
|
392
|
+
schemaName = schemaName.replaceAll(':','_')
|
|
393
|
+
schemaName = schemaName.replaceAll(' ','_')
|
|
394
|
+
cmdbSchemaList.push(schemaName)
|
|
395
|
+
schemas[schemaName] = {
|
|
396
|
+
required: schemas['cmdbobject'].required.concat(classSchema.required),
|
|
397
|
+
properties: {...schemas['cmdbobject'].properties, ...classSchema.properties}
|
|
398
|
+
}
|
|
399
|
+
log.debug('customForm', formName, fields, classMapping, classSchema)
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
paths = {...paths, ... await getPathDef('cmdbobject', '/v1/cmdbobjects', cmdbSchemaList)}
|
|
403
|
+
}
|
|
404
|
+
|
|
367
405
|
return {openapi: "3.0.1", info, servers, paths, components: {schemas}}
|
|
368
406
|
}
|
|
369
407
|
|
|
370
|
-
async function getPathDef(objectName, baseUri,
|
|
408
|
+
async function getPathDef(objectName, baseUri, schema, isSubTicket, suppressUpdate, suppressCreate) {
|
|
409
|
+
let tag = [schema]
|
|
410
|
+
if (Array.isArray(schema)) {
|
|
411
|
+
tag = schema
|
|
412
|
+
}
|
|
413
|
+
|
|
371
414
|
const ticketIdParam = {
|
|
372
415
|
name: "ticketId",
|
|
373
416
|
description: "id of the parent object to retrieve",
|
|
@@ -396,39 +439,39 @@ async function getPathDef(objectName, baseUri, tag, isSubTicket, suppressUpdate,
|
|
|
396
439
|
pathDef[`${baseUri}/{id}`] = {
|
|
397
440
|
parameters,
|
|
398
441
|
get: {
|
|
399
|
-
tags:
|
|
442
|
+
tags: tag,
|
|
400
443
|
summary: `Get a single ${objectName} object by id`,
|
|
401
444
|
description: "A single object is returned in the data attribute",
|
|
402
445
|
parameters: [],
|
|
403
|
-
responses: await getApiResponse(
|
|
446
|
+
responses: await getApiResponse(schema, true)
|
|
404
447
|
}
|
|
405
448
|
}
|
|
406
449
|
if (!suppressUpdate) {
|
|
407
450
|
pathDef[`${baseUri}/{id}`].put = {
|
|
408
|
-
tags:
|
|
451
|
+
tags: tag,
|
|
409
452
|
summary: `Update an object of type ${objectName}`,
|
|
410
453
|
description: "A single object is returned in the data attribute",
|
|
411
454
|
parameters: [],
|
|
412
|
-
responses: await getApiResponse(
|
|
455
|
+
responses: await getApiResponse(schema, false)
|
|
413
456
|
}
|
|
414
457
|
}
|
|
415
458
|
|
|
416
459
|
pathDef[`${baseUri}`] = {
|
|
417
460
|
get: {
|
|
418
|
-
tags:
|
|
461
|
+
tags: tag,
|
|
419
462
|
summary: `Get a list of object of type ${objectName}`,
|
|
420
463
|
description: "An array ob objects is returned in the data attribute",
|
|
421
464
|
parameters: [],
|
|
422
|
-
responses: await getApiResponse(
|
|
465
|
+
responses: await getApiResponse(schema, false)
|
|
423
466
|
}
|
|
424
467
|
}
|
|
425
468
|
if (!suppressCreate) {
|
|
426
469
|
pathDef[`${baseUri}`].post = {
|
|
427
|
-
tags:
|
|
470
|
+
tags: tag,
|
|
428
471
|
summary: `Create a new object of type ${objectName}`,
|
|
429
472
|
description: "A single object is returned in the data attribute",
|
|
430
473
|
parameters: [],
|
|
431
|
-
responses: await getApiResponse(
|
|
474
|
+
responses: await getApiResponse(schema, false)
|
|
432
475
|
}
|
|
433
476
|
}
|
|
434
477
|
if (isSubTicket) {
|
|
@@ -438,6 +481,18 @@ async function getPathDef(objectName, baseUri, tag, isSubTicket, suppressUpdate,
|
|
|
438
481
|
}
|
|
439
482
|
|
|
440
483
|
async function getApiResponse(schema, single) {
|
|
484
|
+
let dataValue = {
|
|
485
|
+
"$ref": `#/components/schemas/${schema}`
|
|
486
|
+
}
|
|
487
|
+
if (Array.isArray(schema)) {
|
|
488
|
+
dataValue = {
|
|
489
|
+
oneOf: schema.map(item => {
|
|
490
|
+
return {
|
|
491
|
+
"$ref": `#/components/schemas/${item}`
|
|
492
|
+
}
|
|
493
|
+
})
|
|
494
|
+
}
|
|
495
|
+
}
|
|
441
496
|
responses = {
|
|
442
497
|
"200": {
|
|
443
498
|
description: "successful operation",
|
|
@@ -456,24 +511,20 @@ async function getApiResponse(schema, single) {
|
|
|
456
511
|
if (!single) {
|
|
457
512
|
responses["200"].content["application/json"].schema.properties.data = {
|
|
458
513
|
type: "array",
|
|
459
|
-
items:
|
|
460
|
-
"$ref": `#/components/schemas/${schema}`
|
|
461
|
-
}
|
|
514
|
+
items: dataValue
|
|
462
515
|
}
|
|
463
516
|
} else {
|
|
464
|
-
responses["200"].content["application/json"].schema.properties.data =
|
|
465
|
-
"$ref": `#/components/schemas/${schema}`
|
|
466
|
-
}
|
|
517
|
+
responses["200"].content["application/json"].schema.properties.data = dataValue
|
|
467
518
|
}
|
|
468
519
|
return responses
|
|
469
520
|
}
|
|
470
521
|
|
|
471
|
-
async function getObjectSchema(
|
|
522
|
+
async function getObjectSchema(clientFields, mapping, formName) {
|
|
472
523
|
const fields = await getFields(formName)
|
|
473
524
|
const required = []
|
|
474
525
|
const properties = {}
|
|
475
|
-
log.debug('
|
|
476
|
-
|
|
526
|
+
log.debug('clientFields', clientFields, mapping, formName)
|
|
527
|
+
clientFields.forEach(field => {
|
|
477
528
|
const mappedName = mapping[field]
|
|
478
529
|
const fieldDef = {}
|
|
479
530
|
const fieldDetails = fields.find(item => item.name === field)
|
|
@@ -544,6 +595,7 @@ const ticketConfig = {
|
|
|
544
595
|
"requestIdField": "Request ID",
|
|
545
596
|
"requestType": "workOrder",
|
|
546
597
|
"ticketIdField": "WorkOrder_ID",
|
|
598
|
+
"businessServiceReconIdField": "CI_ReconId",
|
|
547
599
|
"requestTypeWorkLog": "workOrderWorklog",
|
|
548
600
|
"requestTemplate": "workOrderTemplate",
|
|
549
601
|
"baseURI": "/v1/workorders",
|
|
@@ -562,6 +614,7 @@ const ticketConfig = {
|
|
|
562
614
|
"requestIdField": "Entry ID",
|
|
563
615
|
"requestType": "incident",
|
|
564
616
|
"ticketIdField": "Incident Number",
|
|
617
|
+
businessServiceReconIdField: "ServiceCI_ReconID",
|
|
565
618
|
"requestTypeWorkLog": "incidentWorklog",
|
|
566
619
|
"requestTemplate": "incidentTemplate",
|
|
567
620
|
"baseURI": "/v1/incidents",
|
|
@@ -580,6 +633,7 @@ const ticketConfig = {
|
|
|
580
633
|
"requestIdField": "Request ID",
|
|
581
634
|
"requestType": "change",
|
|
582
635
|
"ticketIdField": "Infrastructure Change Id",
|
|
636
|
+
businessServiceReconIdField: "ServiceCI_ReconID",
|
|
583
637
|
"requestTypeWorkLog": "changeWorklog",
|
|
584
638
|
"requestTemplate": "changeTemplate",
|
|
585
639
|
"baseURI": "/v1/changes",
|
|
@@ -598,6 +652,7 @@ const ticketConfig = {
|
|
|
598
652
|
"requestIdField": "Sys-Problem Investigation ID",
|
|
599
653
|
"requestType": "problem",
|
|
600
654
|
"ticketIdField": "Problem Investigation ID",
|
|
655
|
+
businessServiceReconIdField: "ServiceCI_ReconID",
|
|
601
656
|
"requestTypeWorkLog": "problemWorklog",
|
|
602
657
|
"requestTemplate": "problemTemplate",
|
|
603
658
|
"baseURI": "/v1/problems",
|