@manyos/smileconnect-api 1.41.3 → 1.41.4

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
@@ -607,7 +607,8 @@
607
607
  "taskWorklog": {
608
608
  "fields": [
609
609
  "Summary",
610
- "Notes"
610
+ "Notes",
611
+ "View Access"
611
612
  ],
612
613
  "constants": [
613
614
  {
@@ -621,10 +622,6 @@
621
622
  {
622
623
  "name": "Communication Source",
623
624
  "value": "Other"
624
- },
625
- {
626
- "name": "View Access",
627
- "value": "Internal"
628
625
  }
629
626
  ],
630
627
  "basequery": "",
package/conf/mapping.json CHANGED
@@ -949,6 +949,10 @@
949
949
  {
950
950
  "oldName": "TaskOrTaskGroupInstanceId",
951
951
  "newName": "TaskOrTaskGroupInstanceId"
952
+ },
953
+ {
954
+ "oldName": "View Access",
955
+ "newName": "viewAccess"
952
956
  }
953
957
  ],
954
958
  "flowBuilder": [
@@ -113,7 +113,7 @@ async function createTask(clientConfig, rootForm, rootRequestId, taskData, creat
113
113
  }
114
114
  }
115
115
  //Todo make dynamic
116
- async function createWorklog(clientConfig, taskId, summary, text, attachment, globalScriptParams) {
116
+ async function createWorklog(clientConfig, taskId, data, globalScriptParams) {
117
117
  const task = await getTask(clientConfig,taskId)
118
118
  const fields = clientConfig.taskWorklog.fields;
119
119
 
@@ -124,19 +124,12 @@ async function createWorklog(clientConfig, taskId, summary, text, attachment, gl
124
124
  const mapping = config.getMapping('taskWorklog');
125
125
 
126
126
  log.debug('mapping', mapping);
127
- let data = {
128
- "Secure Log" : "Yes",
129
- "summary" : summary,
130
- "text" : text,
131
- "TaskOrTaskGroupID" : taskId,
132
- "TaskOrTaskGroupInstanceId" : taskInstanceId
133
- };
134
-
135
- fields.push(
127
+
128
+ /*fields.push(
136
129
  'Secure Log',
137
130
  'TaskOrTaskGroupID',
138
131
  'TaskOrTaskGroupInstanceId'
139
- );
132
+ );*/
140
133
 
141
134
  //run preScripts
142
135
  if (scripts && scripts.preMapping) {
@@ -145,6 +138,10 @@ async function createWorklog(clientConfig, taskId, summary, text, attachment, gl
145
138
 
146
139
  data = mappingUtil.applyMapping2Remedy(data, mapping, clientConfig.taskWorklog.constants, fields);
147
140
 
141
+ //add task ID fields after Mapping
142
+ data["TaskOrTaskGroupID"] = taskId
143
+ data["TaskOrTaskGroupInstanceId"] = taskInstanceId
144
+
148
145
  //run postScripts
149
146
  if (scripts && scripts.postMapping) {
150
147
  await scriptController.runScripts(scripts.postMapping, data, clientConfig.clientId, globalScriptParams);
package/docs/releases.md CHANGED
@@ -2,12 +2,10 @@
2
2
 
3
3
  ## API
4
4
 
5
- ### 1.41.3 - 10.08.21
5
+ ### 1.41.4 - 10.08.21
6
6
 
7
7
  Fix mapping for Ticket Worklogs
8
-
9
- ### 1.41.1 - 10.08.21
10
-
8
+ Fix mapping for Task Worklogs
11
9
  Fix issue with sort in Remedy Adapter
12
10
 
13
11
  ### 1.41.0 - 03.08.21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.41.3",
3
+ "version": "1.41.4",
4
4
  "description": "A proxy and abstraction layer for BMCs IT Service Management Suite",
5
5
  "main": "app.js",
6
6
  "scripts": {
@@ -181,7 +181,7 @@ module.exports = (function () {
181
181
  req.errorStatus = 422;
182
182
  next(errors.array());
183
183
  } else {
184
- task.createWorklog(req.user.config, taskId, req.body.data.summary, req.body.data.text, undefined, req.globalScriptParams)
184
+ task.createWorklog(req.user.config, taskId, req.body.data, req.globalScriptParams)
185
185
  .then(createResult => {
186
186
  const worklogId = createResult['0'];
187
187
  task.getTaskWorklog(req.user.config, taskId, worklogId, req.globalScriptParams).then(result => {
@@ -494,7 +494,7 @@ describe('Integration Tests - Workorders', function () {
494
494
  chai.request(server)
495
495
  .post(`/v1/workorders/${workorder.id}/tasks/${task.id}/worklogs`)
496
496
  .set('Authorization', 'Bearer ' + authUser.access_token)
497
- .send({data: {summary: "Worklog Summary", text: "Worklog Text"}})
497
+ .send({data: {summary: "Worklog Summary", text: "Worklog Text", "viewAccess": "Public"}})
498
498
  .end(function (err, res) {
499
499
  res.should.have.status(200);
500
500
  res.body.data.should.be.an('object');