@manyos/smileconnect-api 1.45.4 → 1.45.6

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.
@@ -55,40 +55,40 @@ async function createTask(clientConfig, rootForm, rootRequestId, taskData, creat
55
55
  const mapping = config.getMapping('task');
56
56
  //add required data
57
57
 
58
- const allTaskFinal = [];
59
- allTask.forEach(thisTask => {
60
- thisTask.TaskName = thisTask.summary;
61
- thisTask.TaskType = 2000;
62
- thisTask.Status = 1000;
63
- thisTask.RootRequestFormName = rootForm;
64
- thisTask.RootRequestMode = "1";
65
- thisTask.RootRequestName = rootRequestId;
66
- thisTask.RootRequestInstanceId = rootRequest.data[0]['InstanceId'];
67
- thisTask.sequence = thisTask.sequence || "1";
68
- allTaskFinal.push(thisTask);
69
- });
58
+ let allTaskFinal = allTask;
70
59
 
71
60
  fields.push('TaskName', 'RootRequestInstanceId', 'TaskType', 'Status', 'RootRequestFormName', 'RootRequestMode', 'RootRequestName', 'sequence')
72
61
 
73
62
  //run preScripts
74
63
  if (scripts && scripts.preMapping) {
75
- await scriptController.runScripts(scripts.preMapping, taskData, clientConfig.clientId, globalScriptParams);
64
+ await scriptController.runScripts(scripts.preMapping, allTaskFinal, clientConfig.clientId, globalScriptParams);
76
65
  }
77
66
 
78
- taskData = mappingUtil.applyMapping2Remedy(taskData, mapping, clientConfig.task.constants, fields);
67
+ allTaskFinal = mappingUtil.applyMapping2Remedy(allTaskFinal, mapping, clientConfig.task.constants, fields);
68
+
69
+ allTaskFinal.forEach(thisTask => {
70
+ thisTask.TaskName = thisTask.Summary;
71
+ thisTask.TaskType = 2000;
72
+ thisTask.Status = 1000;
73
+ thisTask.RootRequestFormName = rootForm;
74
+ thisTask.RootRequestMode = "1";
75
+ thisTask.RootRequestName = rootRequestId;
76
+ thisTask.RootRequestInstanceId = rootRequest.data[0]['InstanceId'];
77
+ thisTask.sequence = thisTask.Sequence || "1";
78
+ });
79
79
 
80
80
  //run postScripts
81
81
  if (scripts && scripts.postMapping) {
82
- await scriptController.runScripts(scripts.postMapping, taskData, clientConfig.clientId, globalScriptParams);
82
+ await scriptController.runScripts(scripts.postMapping, allTaskFinal, clientConfig.clientId, globalScriptParams);
83
83
  }
84
84
 
85
- const taskResult = await arquery.createEntry('TMS:Task', taskData, clientConfig.options)
85
+ const taskResult = await arquery.createEntry('TMS:Task', allTaskFinal, clientConfig.options)
86
86
  const taskId = taskResult['0'];
87
87
  globalScriptParams.id2 = taskId;
88
88
 
89
89
  //run afterExecution
90
90
  if (scripts && scripts.afterExecution) {
91
- await scriptController.runScripts(scripts.afterExecution, taskData, clientConfig.clientId, globalScriptParams);
91
+ await scriptController.runScripts(scripts.afterExecution, allTaskFinal, clientConfig.clientId, globalScriptParams);
92
92
  }
93
93
 
94
94
  log.debug('Create Task Result', taskResult);
package/docs/releases.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## API
4
4
 
5
- ### 1.45.4 - 05.10.21
5
+ ### 1.45.6 - 05.10.21
6
6
  Fix issue: Use normal Task mapping for new tasks and existing tasks as no Interface Create Form is used.
7
7
 
8
8
  ### 1.45.2 - 05.10.21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.45.4",
3
+ "version": "1.45.6",
4
4
  "description": "A proxy and abstraction layer for BMCs IT Service Management Suite",
5
5
  "main": "app.js",
6
6
  "scripts": {