Skip to content

Commit bfa4b64

Browse files
hard code the transition id for In Progress
1 parent 64afd6e commit bfa4b64

File tree

1 file changed

+2
-33
lines changed
  • jira-webhook/src/app/api/update-jira-issue

1 file changed

+2
-33
lines changed

Diff for: jira-webhook/src/app/api/update-jira-issue/route.ts

+2-33
Original file line numberDiff line numberDiff line change
@@ -43,38 +43,7 @@ export async function POST(request: Request) {
4343
}, { status: updateResponse.status });
4444
}
4545

46-
// Fetch available transitions
47-
const transitionsResponse = await fetch(jiraTransitionUrl, {
48-
method: 'GET',
49-
headers: {
50-
'Accept': 'application/json',
51-
'Authorization': `Basic ${jiraAuth}`,
52-
},
53-
});
54-
55-
if (!transitionsResponse.ok) {
56-
return Response.json({
57-
error: 'Failed to fetch transitions',
58-
status: transitionsResponse.status,
59-
statusText: transitionsResponse.statusText,
60-
}, { status: transitionsResponse.status });
61-
}
62-
63-
const transitions = await transitionsResponse.json();
64-
console.log("Available transitions:", transitions);
65-
66-
// Find the "In Progress" transition
67-
const inProgressTransition = transitions.transitions.find(
68-
(t: any) => t.name === "In Progress"
69-
);
70-
71-
console.log("=============inProgressTransition", inProgressTransition)
72-
73-
if (!inProgressTransition) {
74-
return Response.json({ error: 'In Progress transition not found' }, { status: 400 });
75-
}
76-
77-
// Then, transition the issue to "In Progress"
46+
// Transition the issue to "In Progress" using the known transition ID
7847
const transitionResponse = await fetch(jiraTransitionUrl, {
7948
method: 'POST',
8049
headers: {
@@ -84,7 +53,7 @@ export async function POST(request: Request) {
8453
},
8554
body: JSON.stringify({
8655
transition: {
87-
id: inProgressTransition.id
56+
id: "21" // Hardcoded "In Progress" transition ID
8857
}
8958
}),
9059
});

0 commit comments

Comments
 (0)