@manyos/smileconnect-api 1.55.1 → 1.55.3
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/adapterConfig.js +1 -1
- package/conf/clients.json +27 -24
- package/conf/scripts/INC_CreateWorklog_OnCreate.js +10 -0
- package/conf/scripts/count.js +2 -0
- package/conf/scripts/slash.js +2 -0
- package/controller/customFormController.js +1 -1
- package/controller/ticketController.js +1 -1
- package/docs/releases.md +12 -0
- package/package.json +1 -1
- package/util/cache.service.js +7 -3
- package/util/responsehandler.js +1 -1
package/conf/adapterConfig.js
CHANGED
package/conf/clients.json
CHANGED
|
@@ -159,7 +159,25 @@
|
|
|
159
159
|
"fields": [
|
|
160
160
|
"Remedy Login ID",
|
|
161
161
|
"Full Name"
|
|
162
|
-
]
|
|
162
|
+
],
|
|
163
|
+
"scripts": {
|
|
164
|
+
"GET": {
|
|
165
|
+
"preMapping": [],
|
|
166
|
+
"postMapping": []
|
|
167
|
+
},
|
|
168
|
+
"PUT": {
|
|
169
|
+
"preMapping": [
|
|
170
|
+
"slash"
|
|
171
|
+
],
|
|
172
|
+
"postMapping": [],
|
|
173
|
+
"afterExecution": []
|
|
174
|
+
},
|
|
175
|
+
"POST": {
|
|
176
|
+
"preMapping": [],
|
|
177
|
+
"postMapping": [],
|
|
178
|
+
"afterExecution": []
|
|
179
|
+
}
|
|
180
|
+
}
|
|
163
181
|
},
|
|
164
182
|
"custom_TMS:Task": {
|
|
165
183
|
"basequery": "1=1",
|
|
@@ -463,36 +481,21 @@
|
|
|
463
481
|
"basequery": "1=1",
|
|
464
482
|
"scripts": {
|
|
465
483
|
"GET": {
|
|
466
|
-
"preMapping": [
|
|
467
|
-
|
|
468
|
-
]
|
|
469
|
-
"postMapping": [
|
|
470
|
-
"p4",
|
|
471
|
-
"update"
|
|
472
|
-
],
|
|
473
|
-
"afterExecution": [
|
|
474
|
-
"script3"
|
|
475
|
-
]
|
|
484
|
+
"preMapping": [],
|
|
485
|
+
"postMapping": [],
|
|
486
|
+
"afterExecution": []
|
|
476
487
|
},
|
|
477
488
|
"POST": {
|
|
478
|
-
"preMapping": [
|
|
479
|
-
|
|
480
|
-
],
|
|
481
|
-
"postMapping": [
|
|
482
|
-
"p3"
|
|
483
|
-
],
|
|
489
|
+
"preMapping": [],
|
|
490
|
+
"postMapping": [],
|
|
484
491
|
"afterExecution": [
|
|
485
|
-
"
|
|
492
|
+
"INC_CreateWorklog_OnCreate"
|
|
486
493
|
]
|
|
487
494
|
},
|
|
488
495
|
"PUT": {
|
|
489
496
|
"preMapping": [],
|
|
490
|
-
"postMapping": [
|
|
491
|
-
|
|
492
|
-
],
|
|
493
|
-
"afterExecution": [
|
|
494
|
-
"p4"
|
|
495
|
-
]
|
|
497
|
+
"postMapping": [],
|
|
498
|
+
"afterExecution": []
|
|
496
499
|
}
|
|
497
500
|
}
|
|
498
501
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
log.debug('ID of my new Ticket:', globalScriptParams, clientId)
|
|
2
|
+
|
|
3
|
+
const worklogData = {
|
|
4
|
+
summary: 'New SMILEconnect Ticket',
|
|
5
|
+
text: `Dieses Ticket wurde ueber SMILEconnect (${clientId}) angelegt.`
|
|
6
|
+
}
|
|
7
|
+
const result = await adapter.smileconnect.createTicketWorklog('incidents', globalScriptParams.id, {data: worklogData})
|
|
8
|
+
log.debug(result);
|
|
9
|
+
|
|
10
|
+
resolve()
|
|
@@ -10,7 +10,7 @@ const {getIncludeArray, applyCustomFormMapping} = require('../util/paramHelper')
|
|
|
10
10
|
const scriptController = require('./scriptController');
|
|
11
11
|
const mappingUtil = require('../util/mappingUtil');
|
|
12
12
|
|
|
13
|
-
const ticketCache = new CacheService(process.env.CACHETTL_TICKETS ||
|
|
13
|
+
const ticketCache = new CacheService(process.env.CACHETTL_TICKETS || 0); // Create a new cache service instance
|
|
14
14
|
|
|
15
15
|
function getIdField(formConfig) {
|
|
16
16
|
const mapping = formConfig.mapping
|
|
@@ -12,7 +12,7 @@ const ticketCIRelationController = require('./ticketCIRelationController');
|
|
|
12
12
|
const scriptController = require('./scriptController');
|
|
13
13
|
const mappingUtil = require('../util/mappingUtil');
|
|
14
14
|
|
|
15
|
-
const ticketCache = new CacheService(process.env.CACHETTL_TICKETS ||
|
|
15
|
+
const ticketCache = new CacheService(process.env.CACHETTL_TICKETS || 0); // Create a new cache service instance
|
|
16
16
|
|
|
17
17
|
function getTickets(ticketConfig, config, includeString, customOptions, globalScriptParams) {
|
|
18
18
|
let query = '1=1';
|
package/docs/releases.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## API
|
|
4
4
|
|
|
5
|
+
### 1.55.3 - 01.03.22
|
|
6
|
+
Ensure TTL of 0 disables cache for Remedy Adapter
|
|
7
|
+
|
|
8
|
+
### 1.55.2 - 14.02.22
|
|
9
|
+
Use custom login Id instead of azp also for eventlog
|
|
10
|
+
|
|
5
11
|
### 1.55.1 - 09.02.22
|
|
6
12
|
Add reconId only for BMC.ASSET dataset
|
|
7
13
|
|
|
@@ -135,6 +141,12 @@ e.g.
|
|
|
135
141
|
|
|
136
142
|
## Event Manager
|
|
137
143
|
|
|
144
|
+
### 1.21.0 - 14.02.22
|
|
145
|
+
Add Auto Resolve to Scripts
|
|
146
|
+
|
|
147
|
+
### 1.20.0 - 14.02.22
|
|
148
|
+
Improve logging
|
|
149
|
+
|
|
138
150
|
### 1.19.0 - 09.11.21
|
|
139
151
|
Allow 16k header
|
|
140
152
|
|
package/package.json
CHANGED
package/util/cache.service.js
CHANGED
|
@@ -7,14 +7,18 @@ class Cache {
|
|
|
7
7
|
constructor(ttlSeconds) {
|
|
8
8
|
log.debug('cache created. ttl seconds:', ttlSeconds);
|
|
9
9
|
this.cache = new NodeCache({ stdTTL: ttlSeconds, checkperiod: ttlSeconds * 0.2, useClones: false });
|
|
10
|
+
if (ttlSeconds == 0) {
|
|
11
|
+
this.disabled = true;
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
get(key, storeFunction) {
|
|
15
|
+
get(key, storeFunction, bypassCache) {
|
|
13
16
|
const value = this.cache.get(key);
|
|
14
|
-
if (value) {
|
|
17
|
+
if (value && (!(bypassCache === true) || bypassCache === undefined) && (!(this.disabled === true) || this.disabled === undefined)) {
|
|
18
|
+
log.debug('Use cache value')
|
|
15
19
|
return Promise.resolve(value);
|
|
16
20
|
}
|
|
17
|
-
|
|
21
|
+
log.debug('Use live query')
|
|
18
22
|
return storeFunction().then((result) => {
|
|
19
23
|
this.cache.set(key, result);
|
|
20
24
|
return result;
|
package/util/responsehandler.js
CHANGED