From 206ca6abf178dcd8375cf8ecf80313ef28f8ddd0 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar <70131915+Saurabhkmr98@users.noreply.github.com> Date: Mon, 25 Aug 2025 15:09:13 +0530 Subject: [PATCH] [SILO-461] fix: use state groups to map issue sync in Github #3987 --- .../workers/github/event-handlers/issue.handler.ts | 9 --------- packages/etl/src/github/etl/transform-to-plane.ts | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/apps/silo/src/apps/github/workers/github/event-handlers/issue.handler.ts b/apps/silo/src/apps/github/workers/github/event-handlers/issue.handler.ts index 665719ccab..ff57bf2e23 100644 --- a/apps/silo/src/apps/github/workers/github/event-handlers/issue.handler.ts +++ b/apps/silo/src/apps/github/workers/github/event-handlers/issue.handler.ts @@ -130,17 +130,8 @@ export const syncIssueWithPlane = async (store: Store, data: GithubIssueDedupPay issue ? true : false ); - const states = (await planeClient.state.list(entityConnection.workspace_slug, entityConnection.project_id ?? "")) - .results; const users = await planeClient.users.list(entityConnection.workspace_slug, entityConnection.project_id ?? ""); - if (planeIssue.state) { - const state = states.find((s) => s.name === planeIssue.state); - if (state) { - planeIssue.state = state.id; - } - } - if (planeIssue.labels) { const labels = (await planeClient.label.list(entityConnection.workspace_slug, entityConnection.project_id ?? "")) .results; diff --git a/packages/etl/src/github/etl/transform-to-plane.ts b/packages/etl/src/github/etl/transform-to-plane.ts index 6c4a87af61..58fcf9a105 100644 --- a/packages/etl/src/github/etl/transform-to-plane.ts +++ b/packages/etl/src/github/etl/transform-to-plane.ts @@ -83,8 +83,8 @@ export const transformGitHubIssue = async ( let targetState: string | undefined = undefined; if (issue.state) { const states = (await planeClient.state.list(workspaceSlug, projectId)).results; - const backlogState = states.find((state) => state.name.toLowerCase() === "backlog"); - const doneState = states.find((state) => state.name.toLowerCase() === "done"); + const backlogState = states.find((state) => state.group === "backlog"); + const doneState = states.find((state) => state.group === "completed"); if (issue.state === "open") { targetState = backlogState?.id; } else if (issue.state === "closed") {