mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
Improve handling of unknown JIRA event types.
(imported from commit d9f823dc80b26a71f7b3a891559d2360d76a258f)
This commit is contained in:
@@ -426,6 +426,9 @@ def api_jira_webhook(request, user_profile):
|
|||||||
if comment != '':
|
if comment != '':
|
||||||
comment = convert_jira_markup(comment, user_profile.realm)
|
comment = convert_jira_markup(comment, user_profile.realm)
|
||||||
content += "\n%s\n" % (comment,)
|
content += "\n%s\n" % (comment,)
|
||||||
|
elif event in ['jira:worklog_updated']:
|
||||||
|
# We ignore these event types
|
||||||
|
return json_success()
|
||||||
elif 'transition' in payload:
|
elif 'transition' in payload:
|
||||||
from_status = get_in(payload, ['transition', 'from_status'])
|
from_status = get_in(payload, ['transition', 'from_status'])
|
||||||
to_status = get_in(payload, ['transition', 'to_status'])
|
to_status = get_in(payload, ['transition', 'to_status'])
|
||||||
@@ -433,7 +436,10 @@ def api_jira_webhook(request, user_profile):
|
|||||||
else:
|
else:
|
||||||
# Unknown event type
|
# Unknown event type
|
||||||
if not settings.TEST_SUITE:
|
if not settings.TEST_SUITE:
|
||||||
logging.warning("Got JIRA event type we don't understand: %s" % (event,))
|
if event is None:
|
||||||
|
logging.warning("Got JIRA event with None event type: %s" % (payload,))
|
||||||
|
else:
|
||||||
|
logging.warning("Got JIRA event type we don't understand: %s" % (event,))
|
||||||
return json_error("Unknown JIRA event type")
|
return json_error("Unknown JIRA event type")
|
||||||
|
|
||||||
check_send_message(user_profile, get_client("ZulipJIRAWebhook"), "stream",
|
check_send_message(user_profile, get_client("ZulipJIRAWebhook"), "stream",
|
||||||
|
|||||||
Reference in New Issue
Block a user