[SILO-461] fix: use state groups to map issue sync in Github #3987

This commit is contained in:
Saurabh Kumar
2025-08-25 15:09:13 +05:30
committed by GitHub
parent a9884676c5
commit 206ca6abf1
2 changed files with 2 additions and 11 deletions

View File

@@ -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;

View File

@@ -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") {