Skip to content

Commit

Permalink
added error msg for workflow not having close status
Browse files Browse the repository at this point in the history
  • Loading branch information
maira-samtek committed Mar 5, 2024
1 parent 578b3bf commit c957162
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/libs/jira-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c957162

Please sign in to comment.