Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
github: Include old issue number in transfer message for new repo.
Aditya Kumar Kasaudhan18d83534ffca
diff --git a/zerver/webhooks/github/tests.py b/zerver/webhooks/github/tests.pyindex 5016308ca57..00ed070516a 100644--- a/zerver/webhooks/github/tests.py+++ b/zerver/webhooks/github/tests.py@@ -236,7 +236,7 @@ class GitHubWebhookTest(WebhookTestCase):)def test_issue_transfer_opened_message(self) -> None:- expected_message = "[Issue #4 Fixture collection](https://github.com/CrisisCollab/admin-frontend-mvp/issues/4) was transferred from CrisisCollab/TestWebhook."+ expected_message = "[Issue #4 Fixture collection](https://github.com/CrisisCollab/admin-frontend-mvp/issues/4) was transferred from [CrisisCollab/TestWebhook#4](https://github.com/CrisisCollab/TestWebhook/issues/4)."expected_topic_name = "admin-frontend-mvp / issue #4 Fixture collection"self.check_webhook("issues__opened_via_transfer",diff --git a/zerver/webhooks/github/view.py b/zerver/webhooks/github/view.pyindex 4978b15d176..c97885ffac9 100644--- a/zerver/webhooks/github/view.py+++ b/zerver/webhooks/github/view.py@@ -703,12 +703,14 @@ def get_issue_transferred_body(helper: Helper) -> str:def get_issue_opened_via_transfer_body(helper: Helper) -> str:payload = helper.payload- template = "[Issue #{new_issue_number} {title}]({new_issue_url}) was transferred from {old_repo_full_name}."+ template = "[Issue #{new_issue_number} {title}]({new_issue_url}) was transferred from [{old_repo_full_name}#{old_issue_number}]({old_issue_url})."return template.format(new_issue_number=payload["issue"]["number"].tame(check_int),new_issue_url=payload["issue"]["html_url"].tame(check_string),title=payload["issue"]["title"].tame(check_string),old_repo_full_name=payload["changes"]["old_repository"]["full_name"].tame(check_string),+ old_issue_number=payload["changes"]["old_issue"]["number"].tame(check_int),+ old_issue_url=payload["changes"]["old_issue"]["html_url"].tame(check_string),)