Skip to content

Commit

Permalink
make sure it finds in progress state
Browse files Browse the repository at this point in the history
  • Loading branch information
thejackshelton-kunaico committed Aug 28, 2024
1 parent e392490 commit 8d1a9e4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/scripts/update-linear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ async function createLinearReleaseIssue() {
// user that created the API
const me = await linearClient.viewer;

const inProgress =
(await team.states()).nodes.find((state) => state.position === 3)?.id ??
undefined;
// Find the "In Progress" state
const teamStates = await team.states();
const inProgressState = teamStates.nodes.find(
(state) => state.name.toLowerCase() === "in progress"
);
const inProgressStateId = inProgressState?.id ?? undefined;

const issuePayload = await linearClient.createIssue({
teamId: team.id,
Expand All @@ -58,7 +61,7 @@ async function createLinearReleaseIssue() {
projectId: project.id,
priority: 1,
assigneeId: me.id,
stateId: inProgress,
stateId: inProgressStateId,
});

const issueId = (await issuePayload.issue)?.id;
Expand Down

0 comments on commit 8d1a9e4

Please sign in to comment.