Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

integrations: Separate issue milestoned events in GitHub Integration.

Satyam Bansal328c10442444
diff --git a/zerver/webhooks/github/view.py b/zerver/webhooks/github/view.py
index 4987deb00b8..6bee8778216 100644
--- a/zerver/webhooks/github/view.py
+++ b/zerver/webhooks/github/view.py
@@ -162,10 +162,6 @@ def get_issue_body(helper: Helper) -> str:
action = payload["action"].tame(check_string)
issue = payload["issue"]
has_assignee = "assignee" in payload
-
- if action in ("milestoned", "demilestoned"):
- return get_issue_milestoned_or_demilestoned_body(helper)
-
base_message = get_issue_event_message(
user_name=get_sender_name(payload),
action=action,
@@ -750,6 +746,7 @@ EVENT_FUNCTION_MAPPER: Dict[str, Callable[[Helper], str]] = {
"gollum": get_wiki_pages_body,
"issue_comment": get_issue_comment_body,
"issue_labeled_or_unlabeled": get_issue_labeled_or_unlabeled_body,
+ "issue_milestoned_or_demilestoned": get_issue_milestoned_or_demilestoned_body,
"issues": get_issue_body,
"member": get_member_body,
"membership": get_membership_body,
@@ -906,6 +903,8 @@ def get_zulip_event_name(
action = payload["action"].tame(check_string)
if action in ("labeled", "unlabeled"):
return "issue_labeled_or_unlabeled"
+ if action in ("milestoned", "demilestoned"):
+ return "issue_milestoned_or_demilestoned"
else:
return "issues"
elif header_event in list(EVENT_FUNCTION_MAPPER.keys()):