Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jira endDate keyError #949

Open
bsl-abv-management opened this issue Jul 15, 2022 · 0 comments
Open

jira endDate keyError #949

bsl-abv-management opened this issue Jul 15, 2022 · 0 comments

Comments

@bsl-abv-management
Copy link

bsl-abv-management commented Jul 15, 2022

❯ ./bugwarrior-pull
INFO:bugwarrior.db:Service-defined UDAs exist: you can optionally use the `bugwarrior-uda` command to export a list of UDAs you can add to your taskrc file.
INFO:bugwarrior.services:Starting to aggregate remote issues.
INFO:bugwarrior.services:Spawning 1 workers.
Traceback (most recent call last):
  File "./bugwarrior-pull", line 8, in <module>
    sys.exit(pull())
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/bugwarrior/command.py", line 73, in pull
    synchronize(issue_generator, config, main_section, dry_run)
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/bugwarrior/db.py", line 360, in synchronize
    issue_dict = dict(issue)
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/bugwarrior/services/__init__.py", line 414, in keys
    return list(self.__iter__())
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/bugwarrior/services/__init__.py", line 409, in __iter__
    record = self.get_taskwarrior_record()
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/bugwarrior/services/__init__.py", line 305, in get_taskwarrior_record
    self._taskwarrior_record = self.to_taskwarrior()
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/bugwarrior/services/jira.py", line 133, in to_taskwarrior
    'due': self.get_due(),
  File "/Users/bob/Library/Python/3.8/lib/python/site-packages/bugwarrior/services/jira.py", line 164, in get_due
    endDate = sprint['endDate']
KeyError: 'endDate'

this only happens when:
jira.import_sprints_as_tags = True

relevant jql:
jira.query = assignee = bob and (sprint in openSprints() OR sprint in futureSprints()) ORDER BY updated

my tempfix in jira.py:

       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', '').lower() != 'closed', sprints):
               if 'endDate' in sprint :
                   endDate = sprint['endDate']
                   if endDate != '<null>' :
                       return self.parse_date(endDate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants