diff --git a/modules/interfaces/interfaceTicketObjects.py b/modules/interfaces/interfaceTicketObjects.py index cebb043f..d7bed987 100644 --- a/modules/interfaces/interfaceTicketObjects.py +++ b/modules/interfaces/interfaceTicketObjects.py @@ -214,7 +214,9 @@ class TicketSharepointSyncInterface: audit_log.append("Step 2: Reading current JIRA data for comparison...") try: current_jira_tasks = await self.connector_ticket.read_tasks(limit=0) - current_jira_data = self._transform_tasks(current_jira_tasks) + current_jira_data = self._transform_tasks( + current_jira_tasks, include_put=True + ) jira_lookup = { task.data.get("ID"): task.data for task in current_jira_data } @@ -335,7 +337,9 @@ class TicketSharepointSyncInterface: # Write audit log to SharePoint await self._write_audit_log(audit_log, "csv_to_jira") - def _transform_tasks(self, tasks: list[Task]) -> list[Task]: + def _transform_tasks( + self, tasks: list[Task], include_put: bool = False + ) -> list[Task]: """Transforms tasks according to the task_sync_definition.""" transformed_tasks = [] @@ -347,8 +351,8 @@ class TicketSharepointSyncInterface: direction = field_config[0] # "get" or "put" field_path = field_config[1] # List of keys to navigate - # Only process "get" fields (JIRA → CSV) - if direction == "get": + # Get the right fields + if direction == "get" or include_put: # Extract value using the field path value = self._extract_field_value(task.data, field_path) transformed_data[field_name] = value diff --git a/modules/routes/routeJira.py b/modules/routes/routeJira.py index 66564e55..f812da7e 100644 --- a/modules/routes/routeJira.py +++ b/modules/routes/routeJira.py @@ -57,10 +57,10 @@ async def sync_jira(): } # SharePoint file configuration - sync_folder = "Shared Documents/TicketSync" + sync_folder = "/sites//Shared Documents/TicketSync" sync_file = "delta_group_selise_ticket_exchange_list.csv" - backup_folder = "Shared Documents/TicketSync/Backups" - audit_folder = "Shared Documents/TicketSync/AuditLogs" + backup_folder = "/sites//Shared Documents/TicketSync/Backups" + audit_folder = "/sites//Shared Documents/TicketSync/AuditLogs" # Create the jira connector instance jira_connector = await ConnectorTicketJira.create(