mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 22:09:12 +02:00
[SILO-461] fix: use state groups to map issue sync in Github #3987
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user