@manyos/smileconnect-api 1.57.1 → 1.57.2
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/conf/clients.json +46 -2
- package/conf/customFormMapping.json +19 -0
- package/controller/customFormController.js +16 -3
- package/docs/releases.md +3 -0
- package/package.json +1 -1
package/conf/clients.json
CHANGED
|
@@ -2178,6 +2178,18 @@
|
|
|
2178
2178
|
"constants": [],
|
|
2179
2179
|
"scripts": {}
|
|
2180
2180
|
},
|
|
2181
|
+
"custom_MYS:CustomFormTest": {
|
|
2182
|
+
"basequery": "1=1",
|
|
2183
|
+
"fields": [
|
|
2184
|
+
"Request ID",
|
|
2185
|
+
"Short Description",
|
|
2186
|
+
"Submitter",
|
|
2187
|
+
"Status",
|
|
2188
|
+
"Submitter"
|
|
2189
|
+
],
|
|
2190
|
+
"constants": [],
|
|
2191
|
+
"scripts": {}
|
|
2192
|
+
},
|
|
2181
2193
|
"changeWorklog": {
|
|
2182
2194
|
"fields": [
|
|
2183
2195
|
"Description",
|
|
@@ -2255,6 +2267,38 @@
|
|
|
2255
2267
|
"basequery": "",
|
|
2256
2268
|
"scripts": {}
|
|
2257
2269
|
},
|
|
2270
|
+
"custom_AST:ComputerSystem": {
|
|
2271
|
+
"basequery": "1=1",
|
|
2272
|
+
"fields": [
|
|
2273
|
+
"Instance Id",
|
|
2274
|
+
"Reconciliation Identity",
|
|
2275
|
+
"Name",
|
|
2276
|
+
"Short Description",
|
|
2277
|
+
"Asset ID+"
|
|
2278
|
+
],
|
|
2279
|
+
"constants": [
|
|
2280
|
+
{
|
|
2281
|
+
"name": "Data Set Id",
|
|
2282
|
+
"value": "BMC.ASSET"
|
|
2283
|
+
}
|
|
2284
|
+
],
|
|
2285
|
+
"scripts": {
|
|
2286
|
+
"GET": {
|
|
2287
|
+
"preMapping": [],
|
|
2288
|
+
"postMapping": []
|
|
2289
|
+
},
|
|
2290
|
+
"PUT": {
|
|
2291
|
+
"preMapping": [],
|
|
2292
|
+
"postMapping": [],
|
|
2293
|
+
"afterExecution": []
|
|
2294
|
+
},
|
|
2295
|
+
"POST": {
|
|
2296
|
+
"preMapping": [],
|
|
2297
|
+
"postMapping": [],
|
|
2298
|
+
"afterExecution": []
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
},
|
|
2258
2302
|
"incident": {
|
|
2259
2303
|
"fields": [
|
|
2260
2304
|
"Incident Number",
|
|
@@ -2317,10 +2361,10 @@
|
|
|
2317
2361
|
"basequery": "1=1",
|
|
2318
2362
|
"scripts": {
|
|
2319
2363
|
"GET": {
|
|
2320
|
-
"preMapping": [
|
|
2364
|
+
"preMapping": [],
|
|
2365
|
+
"postMapping": [
|
|
2321
2366
|
"createRecord"
|
|
2322
2367
|
],
|
|
2323
|
-
"postMapping": [],
|
|
2324
2368
|
"afterExecution": []
|
|
2325
2369
|
},
|
|
2326
2370
|
"POST": {
|
|
@@ -19,6 +19,14 @@
|
|
|
19
19
|
"Department": "Department"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
+
"customFormTest": {
|
|
23
|
+
"formName": "MYS:CustomFormTest",
|
|
24
|
+
"mapping": {
|
|
25
|
+
"Short Description": "shortDescription",
|
|
26
|
+
"Submitter": "submitter",
|
|
27
|
+
"Status": "status"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
22
30
|
"Tasks": {
|
|
23
31
|
"formName": "TMS:Task",
|
|
24
32
|
"mapping": {
|
|
@@ -71,5 +79,16 @@
|
|
|
71
79
|
"Class Id": "class",
|
|
72
80
|
"Class Id2": "class4"
|
|
73
81
|
}
|
|
82
|
+
},
|
|
83
|
+
"computerSystem": {
|
|
84
|
+
"formName": "AST:ComputerSystem",
|
|
85
|
+
"mapping": {
|
|
86
|
+
"Name": "name",
|
|
87
|
+
"DatasetId": "dataSetId",
|
|
88
|
+
"Asset ID+": "id",
|
|
89
|
+
"Reconciliation Identity": "reconId",
|
|
90
|
+
"Instance Id": "instanceId",
|
|
91
|
+
"Short Description": "shortDescription"
|
|
92
|
+
}
|
|
74
93
|
}
|
|
75
94
|
}
|
|
@@ -27,6 +27,7 @@ function getRecords(formConfig, clientConfig, includeString, customOptions, glob
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async function createRecord(formConfig, clientConfig, data, globalScriptParams) {
|
|
30
|
+
const idField = getIdField(formConfig)
|
|
30
31
|
const allScripts = clientConfig[formConfig.configName].scripts;
|
|
31
32
|
let scripts
|
|
32
33
|
if (allScripts) {
|
|
@@ -55,15 +56,27 @@ async function createRecord(formConfig, clientConfig, data, globalScriptParams)
|
|
|
55
56
|
const result = await arquery.createEntry(formConfig.formName, data, clientConfig.options)
|
|
56
57
|
|
|
57
58
|
log.debug('RecordCreateResult', result.data);
|
|
58
|
-
|
|
59
|
+
let recordCreateId = Object.values(result)[0];
|
|
59
60
|
//Find change id
|
|
60
|
-
|
|
61
|
+
if (!recordCreateId) {
|
|
62
|
+
recordCreateId = data[idField]
|
|
63
|
+
}
|
|
64
|
+
if (!recordCreateId) {
|
|
65
|
+
throw ({message: `Id of new record could not be determined. Please provide ${idField} for join forms.`})
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
log.error(idField)
|
|
69
|
+
log.error(recordCreateId)
|
|
70
|
+
|
|
71
|
+
//const query = `'${idField}'=\"${recordCreateId}\"`;
|
|
72
|
+
|
|
73
|
+
/*const resultInterfaceCreate = await arquery.executeARQuery(formConfig.formName, null, query, formConfig.ticketIdField, clientConfig.options)
|
|
61
74
|
if (resultInterfaceCreate.data && Array.isArray(resultInterfaceCreate.data) && resultInterfaceCreate.data.length > 0) {
|
|
62
75
|
const recordCreateId = resultInterfaceCreate.data[0][formConfig.ticketIdField];
|
|
63
76
|
} else {
|
|
64
77
|
log.error('Cannot create Record', resultInterfaceCreate);
|
|
65
78
|
throw({message: 'Cannot create Record', details : resultInterfaceCreate});
|
|
66
|
-
}
|
|
79
|
+
}*/
|
|
67
80
|
globalScriptParams.id = recordCreateId
|
|
68
81
|
//run afterExecution
|
|
69
82
|
if (scripts && scripts.afterExecution) {
|
package/docs/releases.md
CHANGED