Skip to content

Commit

Permalink
Merge pull request #651 from ralphbean/jira-due-date
Browse files Browse the repository at this point in the history
Use explicit due date from jira, if set.
  • Loading branch information
ralphbean authored May 6, 2019
2 parents 8725ae5 + 6397b2b commit b4b471d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bugwarrior/services/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,15 @@ def get_tags(self):
return self._get_tags_from_labels() + self._get_tags_from_sprints()

def get_due(self):
# If the duedate is explicitly set on the issue, then use that.
if self.record['fields'].get('duedate'):
return self.parse_date(self.record['fields']['duedate'])
# Otherwise, if the issue is in a sprint, use the end date of that sprint.
sprints = self.__get_sprints()
for sprint in filter(lambda e: e.get('state') != 'CLOSED', sprints):
endDate = sprint['endDate']
return '' if endDate == '<null>' else self.parse_date(endDate)
if endDate != '<null>':
return self.parse_date(endDate)

def _get_tags_from_sprints(self):
tags = []
Expand Down

0 comments on commit b4b471d

Please sign in to comment.