diff --git a/src/libs/jira-lib.ts b/src/libs/jira-lib.ts index fd27473..de1cb67 100644 --- a/src/libs/jira-lib.ts +++ b/src/libs/jira-lib.ts @@ -261,6 +261,18 @@ export class Jira { !processedTransitions.includes(transition.name.toLowerCase()) ); if (targetTransitions.length <= 0) { + const lastStatus = + processedTransitions[ + processedTransitions.length - 1 + ].toLowerCase(); + const doneStatuses = ["done", "closed", "close", "complete"]; + if (!doneStatuses.includes(lastStatus)) { + throw new Error( + "Unsupported Workflow: does not contain any of " + + doneStatuses.join(",") + + "statuses" + ); + } break; } const transitionId = targetTransitions[0].id;