diff --git a/test/integration/connectors/expected_results/jira/file_data/10000.json b/test/integration/connectors/expected_results/jira/file_data/10000.json index d777ca11..c56f04c5 100644 --- a/test/integration/connectors/expected_results/jira/file_data/10000.json +++ b/test/integration/connectors/expected_results/jira/file_data/10000.json @@ -15,9 +15,9 @@ "board_id": null, "project_id": "JCTP1" }, - "date_created": null, - "date_modified": null, - "date_processed": "1740409356.9567373", + "date_created": "2023-08-22T11:29:37.774+0000", + "date_modified": "2025-02-21T13:25:46.017+0000", + "date_processed": "1740557828.4891825", "permissions_data": null, "filesize_bytes": null }, @@ -28,6 +28,6 @@ "project_id": "JCTP1" }, "reprocess": false, - "local_download_path": "/tmp/tmpj2ak4ry3/JCTP1/10000.txt", - "display_name": null + "local_download_path": "/tmp/tmpqyce024l/JCTP1/10000.txt", + "display_name": "Jira Connector Test Project 1" } \ No newline at end of file diff --git a/test/integration/connectors/expected_results/jira/file_data/10001.json b/test/integration/connectors/expected_results/jira/file_data/10001.json index 6f4bb920..b20db984 100644 --- a/test/integration/connectors/expected_results/jira/file_data/10001.json +++ b/test/integration/connectors/expected_results/jira/file_data/10001.json @@ -15,9 +15,9 @@ "board_id": null, "project_id": "JCTP1" }, - "date_created": null, - "date_modified": null, - "date_processed": "1740409357.6608434", + "date_created": "2023-08-22T11:29:43.033+0000", + "date_modified": "2023-08-24T12:03:31.591+0000", + "date_processed": "1740557829.0142515", "permissions_data": null, "filesize_bytes": null }, @@ -28,6 +28,6 @@ "project_id": "JCTP1" }, "reprocess": false, - "local_download_path": "/tmp/tmpj2ak4ry3/JCTP1/10001.txt", - "display_name": null + "local_download_path": "/tmp/tmpqyce024l/JCTP1/10001.txt", + "display_name": "Jira Connector Test Project 1" } \ No newline at end of file diff --git a/test/integration/connectors/expected_results/jira/file_data/10002.json b/test/integration/connectors/expected_results/jira/file_data/10002.json index 71d4b3c5..f7ea8049 100644 --- a/test/integration/connectors/expected_results/jira/file_data/10002.json +++ b/test/integration/connectors/expected_results/jira/file_data/10002.json @@ -15,9 +15,9 @@ "board_id": null, "project_id": "JCTP1" }, - "date_created": null, - "date_modified": null, - "date_processed": "1740409358.2943182", + "date_created": "2023-08-22T11:29:46.189+0000", + "date_modified": "2023-08-23T14:36:31.252+0000", + "date_processed": "1740557829.5562248", "permissions_data": null, "filesize_bytes": null }, @@ -28,6 +28,6 @@ "project_id": "JCTP1" }, "reprocess": false, - "local_download_path": "/tmp/tmpj2ak4ry3/JCTP1/10002.txt", - "display_name": null + "local_download_path": "/tmp/tmpqyce024l/JCTP1/10002.txt", + "display_name": "Jira Connector Test Project 1" } \ No newline at end of file diff --git a/test/integration/connectors/expected_results/jira/file_data/10003.json b/test/integration/connectors/expected_results/jira/file_data/10003.json index 08328054..4811fb2a 100644 --- a/test/integration/connectors/expected_results/jira/file_data/10003.json +++ b/test/integration/connectors/expected_results/jira/file_data/10003.json @@ -15,9 +15,9 @@ "board_id": null, "project_id": "JCTP2" }, - "date_created": null, - "date_modified": null, - "date_processed": "1740409359.4585", + "date_created": "2023-08-22T11:32:09.040+0000", + "date_modified": "2023-09-29T05:55:11.447+0000", + "date_processed": "1740557830.5772882", "permissions_data": null, "filesize_bytes": null }, @@ -28,6 +28,6 @@ "project_id": "JCTP2" }, "reprocess": false, - "local_download_path": "/tmp/tmpj2ak4ry3/JCTP2/10003.txt", - "display_name": null + "local_download_path": "/tmp/tmpqyce024l/JCTP2/10003.txt", + "display_name": "Jira Connector Test Project 2" } \ No newline at end of file diff --git a/test/integration/connectors/expected_results/jira/file_data/10004.json b/test/integration/connectors/expected_results/jira/file_data/10004.json index 786ccedc..17419f6f 100644 --- a/test/integration/connectors/expected_results/jira/file_data/10004.json +++ b/test/integration/connectors/expected_results/jira/file_data/10004.json @@ -15,9 +15,9 @@ "board_id": null, "project_id": "JCTP2" }, - "date_created": null, - "date_modified": null, - "date_processed": "1740409360.0712829", + "date_created": "2023-08-22T11:32:15.109+0000", + "date_modified": "2023-09-29T05:55:11.351+0000", + "date_processed": "1740557831.0480325", "permissions_data": null, "filesize_bytes": null }, @@ -28,6 +28,6 @@ "project_id": "JCTP2" }, "reprocess": false, - "local_download_path": "/tmp/tmpj2ak4ry3/JCTP2/10004.txt", - "display_name": null + "local_download_path": "/tmp/tmpqyce024l/JCTP2/10004.txt", + "display_name": "Jira Connector Test Project 2" } \ No newline at end of file diff --git a/test/integration/connectors/expected_results/jira/file_data/10005.json b/test/integration/connectors/expected_results/jira/file_data/10005.json index 4f6221f8..352cccf1 100644 --- a/test/integration/connectors/expected_results/jira/file_data/10005.json +++ b/test/integration/connectors/expected_results/jira/file_data/10005.json @@ -15,9 +15,9 @@ "board_id": null, "project_id": "JCTP2" }, - "date_created": null, - "date_modified": null, - "date_processed": "1740409360.680108", + "date_created": "2023-08-22T11:32:18.249+0000", + "date_modified": "2023-08-22T11:32:21.717+0000", + "date_processed": "1740557831.571495", "permissions_data": null, "filesize_bytes": null }, @@ -28,6 +28,6 @@ "project_id": "JCTP2" }, "reprocess": false, - "local_download_path": "/tmp/tmpj2ak4ry3/JCTP2/10005.txt", - "display_name": null + "local_download_path": "/tmp/tmpqyce024l/JCTP2/10005.txt", + "display_name": "Jira Connector Test Project 2" } \ No newline at end of file diff --git a/test/integration/connectors/expected_results/jira/file_data/10013.json b/test/integration/connectors/expected_results/jira/file_data/10013.json index 265317bb..1e80c4f0 100644 --- a/test/integration/connectors/expected_results/jira/file_data/10013.json +++ b/test/integration/connectors/expected_results/jira/file_data/10013.json @@ -15,9 +15,9 @@ "board_id": null, "project_id": "JCTP1" }, - "date_created": null, - "date_modified": null, - "date_processed": "1740409358.8760052", + "date_created": "2023-08-24T12:04:35.328+0000", + "date_modified": "2023-08-24T12:04:47.543+0000", + "date_processed": "1740557830.0545702", "permissions_data": null, "filesize_bytes": null }, @@ -28,6 +28,6 @@ "project_id": "JCTP1" }, "reprocess": false, - "local_download_path": "/tmp/tmpj2ak4ry3/JCTP1/10013.txt", - "display_name": null + "local_download_path": "/tmp/tmpqyce024l/JCTP1/10013.txt", + "display_name": "Jira Connector Test Project 1" } \ No newline at end of file diff --git a/test/integration/connectors/expected_results/jira/file_data/10014.json b/test/integration/connectors/expected_results/jira/file_data/10014.json index 2d40f5ce..1a275af6 100644 --- a/test/integration/connectors/expected_results/jira/file_data/10014.json +++ b/test/integration/connectors/expected_results/jira/file_data/10014.json @@ -15,9 +15,9 @@ "board_id": "3", "project_id": "JCTP3" }, - "date_created": null, - "date_modified": null, - "date_processed": "1740409356.3731556", + "date_created": "2023-08-24T13:38:35.057+0000", + "date_modified": "2023-08-24T13:39:02.055+0000", + "date_processed": "1740557828.0832858", "permissions_data": null, "filesize_bytes": null }, @@ -28,6 +28,6 @@ "project_id": "JCTP3" }, "reprocess": false, - "local_download_path": "/tmp/tmpj2ak4ry3/JCTP3/10014.txt", - "display_name": null + "local_download_path": "/tmp/tmpqyce024l/JCTP3/10014.txt", + "display_name": "Jira Connector Test Project 3 - Company Managed Project" } \ No newline at end of file diff --git a/unstructured_ingest/v2/processes/connectors/jira.py b/unstructured_ingest/v2/processes/connectors/jira.py index 0601ed82..fd4a948c 100644 --- a/unstructured_ingest/v2/processes/connectors/jira.py +++ b/unstructured_ingest/v2/processes/connectors/jira.py @@ -62,17 +62,17 @@ def __getitem__(self, key): return value -def nested_object_to_field_getter(object: dict) -> Union[FieldGetter, dict]: - if isinstance(object, abc.Mapping): +def nested_object_to_field_getter(obj: dict) -> Union[FieldGetter, dict]: + if isinstance(obj, abc.Mapping): new_object = {} - for k, v in object.items(): + for k, v in obj.items(): if isinstance(v, abc.Mapping): new_object[k] = FieldGetter(nested_object_to_field_getter(v)) else: new_object[k] = v return FieldGetter(new_object) else: - return object + return obj def issues_fetcher_wrapper(func, results_key="results", number_of_issues_to_fetch: int = 100): @@ -401,7 +401,11 @@ def _get_fields_for_comment( return f"{comment['author']['displayName']}{c_sep}{comment['body']}{r_sep}" def form_templated_string( - self, issue: dict, parsed_fields, c_sep: str = "|||", r_sep: str = "\n\n\n" + self, + issue: dict, + parsed_fields: Union[FieldGetter, dict], + c_sep: str = "|||", + r_sep: str = "\n\n\n", ) -> str: """Forms a template string via parsing the fields from the API response object on the issue The template string will be saved to the disk, and then will be processed by partition.""" @@ -444,7 +448,7 @@ def run(self, file_data: FileData, **kwargs: Any) -> DownloadResponse: download_path.parent.mkdir(parents=True, exist_ok=True) with open(download_path, "w") as f: f.write(issue_str) - + self.update_file_data(file_data, issue) return self.generate_download_response(file_data=file_data, download_path=download_path)