Skip to content

Commit

Permalink
FIX new subtask update to JiraTicketUtil when preparing fields
Browse files Browse the repository at this point in the history
Needed to see if 'type' in fields before checking for the value of
fields['type'] in _prepare_ticket_fields() in jira.py.
  • Loading branch information
dmranck committed May 21, 2018
1 parent 9497eb7 commit 2b41e46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ticketutil/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def _prepare_ticket_fields(fields):
:return: fields: Ticket fields in the correct form for the ticketing tool.
:raises: KeyError: While creating Sub Task, if parent is not provided.
"""
if fields['type'] == 'Sub-task' and 'parent' not in fields:
if 'type' in fields and fields['type'] == 'Sub-task' and 'parent' not in fields:
raise KeyError("Parent field is required while creating a Sub Task")

for key, value in fields.items():
Expand Down

1 comment on commit 2b41e46

@dmranck
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fpob made a quick update to your latest commit - something I missed in the review :)

Please sign in to comment.