From 16c0ff82bd8cfee59457d25568e018e3bfc3c6df Mon Sep 17 00:00:00 2001 From: talsabagport Date: Wed, 30 Oct 2024 17:04:35 +0200 Subject: [PATCH] return jira project sync --- integrations/jira/main.py | 22 +++++++++++----------- integrations/jira/pyproject.toml | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/integrations/jira/main.py b/integrations/jira/main.py index c2e1bd39a5..c3d7f701fd 100644 --- a/integrations/jira/main.py +++ b/integrations/jira/main.py @@ -33,17 +33,17 @@ async def setup_application() -> None: ) -# @ocean.on_resync(ObjectKind.PROJECT) -# async def on_resync_projects(kind: str) -> ASYNC_GENERATOR_RESYNC_TYPE: -# client = JiraClient( -# ocean.integration_config["jira_host"], -# ocean.integration_config["atlassian_user_email"], -# ocean.integration_config["atlassian_user_token"], -# ) -# -# async for projects in client.get_paginated_projects(): -# logger.info(f"Received project batch with {len(projects)} issues") -# yield projects +@ocean.on_resync(ObjectKind.PROJECT) +async def on_resync_projects(kind: str) -> ASYNC_GENERATOR_RESYNC_TYPE: + client = JiraClient( + ocean.integration_config["jira_host"], + ocean.integration_config["atlassian_user_email"], + ocean.integration_config["atlassian_user_token"], + ) + + async for projects in client.get_paginated_projects(): + logger.info(f"Received project batch with {len(projects)} issues") + yield projects @ocean.on_resync(ObjectKind.ISSUE) diff --git a/integrations/jira/pyproject.toml b/integrations/jira/pyproject.toml index 91403b6507..0b3563c202 100644 --- a/integrations/jira/pyproject.toml +++ b/integrations/jira/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "jira" -version = "0.1.89-dev043" +version = "0.1.89-dev044" description = "Integration to bring information from Jira into Port" authors = ["Mor Paz "]