Skip to content

Commit

Permalink
fix(Jira): infer in review state correctly
Browse files Browse the repository at this point in the history
* Split in review and done regex so done doesn't get picked
if there is a review state but done comes first.

Closes #29.
  • Loading branch information
tagoro9 committed Mar 17, 2017
1 parent c91db4d commit 0c8a657
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/issue-tracker/jira/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import reporter from '../../reporter';

export const status = {
BACKLOG: 'BACKLOG',
DONE: 'DONE',
IN_PROGRESS: 'IN_PROGRESS',
IN_REVIEW: 'IN_REVIEW',
SELECTED_FOR_DEVELOPMENT: 'SELECTED_FOR_DEVELOPMENT'
Expand All @@ -12,7 +13,8 @@ export const status = {
const statusRegex = {
BACKLOG: /backlog/i,
IN_PROGRESS: /in progress/i,
IN_REVIEW: /review|done/i,
IN_REVIEW: /review/i,
DONE: /done/i,
SELECTED_FOR_DEVELOPMENT: /(todo)|(to do)|(selected for development)/i
};

Expand Down Expand Up @@ -69,7 +71,8 @@ export default R.curryN(2, (config, issue) => {
transitions => ({
[status.BACKLOG]:
statusMatcher(status.BACKLOG)(transitions) || statusMatcher(status.SELECTED_FOR_DEVELOPMENT)(transitions),
[status.IN_PROGRESS]: statusMatcher(status.IN_PROGRESS)(transitions),
[status.IN_PROGRESS]:
statusMatcher(status.IN_PROGRESS)(transitions) || statusMatcher(status.DONE)(transitions),
[status.IN_REVIEW]: statusMatcher(status.IN_REVIEW)(transitions),
[status.SELECTED_FOR_DEVELOPMENT]: statusMatcher(status.SELECTED_FOR_DEVELOPMENT)(transitions),
transitions
Expand Down

0 comments on commit 0c8a657

Please sign in to comment.