@manyos/smileconnect-api 1.55.2 → 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 +6 -0
- package/package.json +1 -1
- package/util/cache.service.js +7 -3
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,9 @@
|
|
|
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
|
+
|
|
5
8
|
### 1.55.2 - 14.02.22
|
|
6
9
|
Use custom login Id instead of azp also for eventlog
|
|
7
10
|
|
|
@@ -138,6 +141,9 @@ e.g.
|
|
|
138
141
|
|
|
139
142
|
## Event Manager
|
|
140
143
|
|
|
144
|
+
### 1.21.0 - 14.02.22
|
|
145
|
+
Add Auto Resolve to Scripts
|
|
146
|
+
|
|
141
147
|
### 1.20.0 - 14.02.22
|
|
142
148
|
Improve logging
|
|
143
149
|
|
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;
|