@manyos/smileconnect-api 1.53.0 → 1.53.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 CHANGED
@@ -161,6 +161,37 @@
161
161
  "Full Name"
162
162
  ]
163
163
  },
164
+ "custom_TMS:Task": {
165
+ "basequery": "1=1",
166
+ "fields": [
167
+ "Task ID",
168
+ "Summary",
169
+ "z1D_WorkInfoNotes",
170
+ "Notes",
171
+ "Assignee Group",
172
+ "Assignee Group ID",
173
+ "Assignee Organization",
174
+ "Support Company",
175
+ "Status"
176
+ ],
177
+ "constants": [],
178
+ "scripts": {
179
+ "GET": {
180
+ "preMapping": [],
181
+ "postMapping": []
182
+ },
183
+ "PUT": {
184
+ "preMapping": [],
185
+ "postMapping": [],
186
+ "afterExecution": []
187
+ },
188
+ "POST": {
189
+ "preMapping": [],
190
+ "postMapping": [],
191
+ "afterExecution": []
192
+ }
193
+ }
194
+ },
164
195
  "cmdbobject": {
165
196
  "basequery": "'Data Set Id' = \"BMC.ASSET\" AND ('Mark As Deleted' = \"No\" OR 'Mark As Deleted' = $NULL$)",
166
197
  "fields": [
@@ -19,6 +19,51 @@
19
19
  "Department": "Department"
20
20
  }
21
21
  },
22
+ "Tasks": {
23
+ "formName": "TMS:Task",
24
+ "mapping": {
25
+ "Summary": "summary",
26
+ "Task ID": "id",
27
+ "Notes": "notes",
28
+ "Status": "status",
29
+ "StatusReasonSelection": "statusReason",
30
+ "Actual Start Date": "actualStartDate",
31
+ "Actual End Date": "actualEndDate",
32
+ "Scheduled Start Date": "scheduledStartDate",
33
+ "Scheduled End Date": "scheduledEndDate",
34
+ "InstanceId": "instanceId",
35
+ "RootRequestFormName": "rootRequestForm",
36
+ "RootRequestID": "rootRequest",
37
+ "Sequence": "sequence",
38
+ "Service Cat Tier 1": "opsCat1",
39
+ "Service Cat Tier 2": "opsCat2",
40
+ "Service Cat Tier 3": "opsCat3",
41
+ "Product Cat Tier 1": "prodCat1",
42
+ "Product Cat Tier 2": "prodCat2",
43
+ "Product Cat Tier 3": "prodCat3",
44
+ "Product Name": "productName",
45
+ "Assignee Group ID": "assignedGroup",
46
+ "Customer Person ID": "customerid",
47
+ "Requested By Person ID": "requestorid",
48
+ "Support Company": "supportCompany",
49
+ "Assignee Organization": "supportOrganization",
50
+ "Assignee Group": "supportGroup",
51
+ "TemplateID": "templateid",
52
+ "TaskName": "taskName",
53
+ "z1D_WorkInfoNotes": "workInfoNotes",
54
+ "z1D_WorkInfoSummary": "workInfoSummary",
55
+ "z1D_WorkInfoType": "workInfoType",
56
+ "z1D_WorkInfoViewAccess": "workInfoViewAccess",
57
+ "z1D_WorkInfoSecureLog": "workInfoSecureLog",
58
+ "Incident Resolution": "incidentResolution",
59
+ "Incident Resolution2": "incidentResolution2",
60
+ "z1D Action": "action",
61
+ "Assignee": "assignee",
62
+ "Assignee Login": "assigneeLogin",
63
+ "Assigned To": "assignedTo",
64
+ "Assignee Id": "assigneeID"
65
+ }
66
+ },
22
67
  "baseElement": {
23
68
  "formName": "AST:BaseElement",
24
69
  "mapping": {
@@ -129,6 +129,20 @@ async function updateTaskFlow(clientConfig, rootForm, rootRequestId, rootRequest
129
129
  "RootRequestInstanceID" : rootRequestInstanceId
130
130
  };
131
131
 
132
+ /*let flowReq2 = {
133
+ "10000000" : "AGGarserver000RD23DCRC3JB8TC9E",
134
+ "10000001" : "PBI000000001807",
135
+ "10000005" : "PBM:Problem Investigation",
136
+ "10001735" : "CREATE_TASK_FLOW",
137
+ "10001751" : "TMGarserver000RD2334RC3J1UTD55",
138
+ "10001753" : "0",
139
+ "10001756" : "AGGarserver000RD23DCRC3JB8TC9E",
140
+ "10002025" : "1",
141
+ "10007302" : "TMGarserver000RD233CRC3J18TD4L",
142
+ "10010305" : "PBI000000001807",
143
+ "1000000001" : "Calbro Services"
144
+ }*/
145
+
132
146
  const mappingflow = config.getMapping('flowBuilder');
133
147
 
134
148
  flowBuilderRequest = mappingUtil.applyMapping2Remedy(flowBuilderRequest, mappingflow, clientConfig.flowBuilder.constants);
@@ -171,10 +185,17 @@ async function checkFlowActivation(clientConfig, rootRequestInstanceId, rootRequ
171
185
 
172
186
  const phaseRecords = await arquery.executeARQuery(form, undefined,
173
187
  configQuery, 'InstanceId')
188
+
189
+ //Todo: Handle records without phases
174
190
  if (phaseRecords && phaseRecords.data && phaseRecords.data.length > 0) {
175
191
  const phaseRecord = phaseRecords.data[0]
176
192
  const phaseGuid = phaseRecord['InstanceId']
177
193
  await activateTaskFlow(clientConfig, rootRequestInstanceId, phaseGuid)
194
+ } else {
195
+ // nur bei Problem sofort aktivieren
196
+ if (rootForm === CONSTANTS.FORM_PROBLEM) {
197
+ activateTaskFlow(clientConfig, rootRequestInstanceId)
198
+ }
178
199
  }
179
200
  }
180
201
 
@@ -191,8 +212,12 @@ async function activateTaskFlow(clientConfig, rootRequestInstanceId, phaseGuid)
191
212
  "zTmpInternal" : "True"
192
213
  };
193
214
 
194
- const records = await arquery.executeARQuery(form, undefined,
195
- `'RootRequestInstanceID'="${rootRequestInstanceId}" AND 'ParentID' = "${rootRequestInstanceId}" AND 'Predecessor Link' = "Start" AND 'Status' = "Pending" AND 'Sequence Mode' = "Yes" AND 'Phase GUID' = "${phaseGuid}"`, idField)
215
+ let query = `'RootRequestInstanceID'="${rootRequestInstanceId}" AND 'ParentID' = "${rootRequestInstanceId}" AND 'Predecessor Link' = "Start" AND 'Status' = "Pending" AND 'Sequence Mode' = "Yes"`
216
+ if (phaseGuid) {
217
+ query += ` AND 'Phase GUID' = "${phaseGuid}"`
218
+ }
219
+
220
+ const records = await arquery.executeARQuery(form, undefined, query, idField)
196
221
  if (records && records.data) {
197
222
  for (let x=0; x<records.data.length; x++) {
198
223
  const record = records.data[x]
package/docs/releases.md CHANGED
@@ -2,19 +2,25 @@
2
2
 
3
3
  ## API
4
4
 
5
- ### 1.53.0 - 17.11.11
5
+ ### 1.53.2 - 03.02.22
6
+ Fix issue: Remove error message on custom form mapping
7
+
8
+ ### 1.53.1 - 01.02.22
9
+ Fix issue: Task Flow Activation for Problems
10
+
11
+ ### 1.53.0 - 17.11.21
6
12
  Update NodeJs to v16
7
13
 
8
- ### 1.52.4 - 17.11.11
14
+ ### 1.52.4 - 17.11.21
9
15
  Fix issue: Keep invisible ServiceCi Relation in Tickets during CI Relation Update
10
16
 
11
- ### 1.52.3 - 16.11.11
17
+ ### 1.52.3 - 16.11.21
12
18
  Fix issue: Add globalParams to update ticket
13
19
 
14
- ### 1.52.2 - 16.11.11
20
+ ### 1.52.2 - 16.11.21
15
21
  Fix issue: Inbound Events Names missed 'Worklog' for Task Worklogs
16
22
 
17
- ### 1.52.1 - 12.11.11
23
+ ### 1.52.1 - 12.11.21
18
24
  Fix issue: Task CI relations might be removed on duplicate updates
19
25
 
20
26
  ### 1.52.0 - 09.11.21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.53.0",
3
+ "version": "1.53.2",
4
4
  "description": "A proxy and abstraction layer for BMCs IT Service Management Suite",
5
5
  "main": "app.js",
6
6
  "scripts": {
@@ -106,11 +106,14 @@ function getFieldsForCreate(mapping, mappingNew, clientFields) {
106
106
  }*/
107
107
 
108
108
  function applyCustomFormMapping(object, mapping, requestIdField) {
109
+ //log.debug('apply mapping', object, mapping)
109
110
  //Apply mapping
110
111
  Object.keys(mapping).forEach(remedyName => {
111
112
  try {
112
113
  const mappedName = mapping[remedyName]
113
- Object.defineProperty(object, mappedName, Object.getOwnPropertyDescriptor(object, remedyName));
114
+ if (object[remedyName] !== undefined) {
115
+ Object.defineProperty(object, mappedName, Object.getOwnPropertyDescriptor(object, remedyName));
116
+ }
114
117
  //delete only if names are different
115
118
  if (mappedName !== remedyName) {
116
119
  delete object[remedyName];