Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit f14c962

Browse files
authored
Merge pull request #61 from SafetyCulture/ACT-1981
[ACT-1981] added 'site', 'title' columns for actions csv
2 parents 631cd86 + 3390c32 commit f14c962

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

tools/exporter/exporter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def save_exported_actions_to_csv_file(logger, export_path, actions_array):
324324
actions_csv_wr.writerow([
325325
'actionId', 'description', 'assignee', 'priority', 'priorityCode', 'status', 'statusCode', 'dueDatetime',
326326
'audit', 'auditId', 'linkedToItem', 'linkedToItemId', 'creatorName', 'creatorId', 'createdDatetime',
327-
'modifiedDatetime', 'completedDatetime'
327+
'modifiedDatetime', 'completedDatetime', 'site', 'title'
328328
])
329329
for action in actions_array:
330330
actions_list = transform_action_object_to_list(action)
@@ -355,6 +355,8 @@ def transform_action_object_to_list(action):
355355
actions_list.append(get_json_property(action, 'created_at'))
356356
actions_list.append(get_json_property(action, 'modified_at'))
357357
actions_list.append(get_json_property(action, 'completed_at'))
358+
actions_list.append(get_json_property(action, 'site'))
359+
actions_list.append(get_json_property(action, 'title'))
358360
return actions_list
359361

360362

tools/exporter/tests/actions_export_test_files/single_action_from_api.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"item_id": "f3245d43-ea77-11e1-aff1-0800200c9a66",
1010
"label": "Prepared by"
1111
},
12+
"title": "test action",
13+
"site": "site1",
1214
"description": "tonys sdk test action",
1315
"priority": 10,
1416
"status": 0,

tools/exporter/tests/actions_export_test_files/single_action_transformed_to_array.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@
1515
"user_fdd054fbf4ef4a069dfc86ff004e7a67",
1616
"2017-11-15T22:43:19.760Z",
1717
"2017-11-15T22:43:19.760Z",
18-
""
18+
"",
19+
"site1",
20+
"test action"
1921
]

0 commit comments

Comments
 (0)