fix: include put for csv -> jira
This commit is contained in:
parent
1a7ca4fa13
commit
fe459731cd
2 changed files with 11 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@ async def sync_jira():
|
|||
}
|
||||
|
||||
# SharePoint file configuration
|
||||
sync_folder = "Shared Documents/TicketSync"
|
||||
sync_folder = "/sites/<YourSite>/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/<YourSite>/Shared Documents/TicketSync/Backups"
|
||||
audit_folder = "/sites/<YourSite>/Shared Documents/TicketSync/AuditLogs"
|
||||
|
||||
# Create the jira connector instance
|
||||
jira_connector = await ConnectorTicketJira.create(
|
||||
|
|
|
|||
Loading…
Reference in a new issue