From 8a648ceb730a19b078138beaeeec6891e46c8fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 11 Mar 2020 16:22:11 +0100 Subject: [PATCH] add possibility to link to an existing redmine issue (#40109) --- sentry_redmine/forms.py | 2 ++ sentry_redmine/plugin.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sentry_redmine/forms.py b/sentry_redmine/forms.py index 328cd52..0cb9a8d 100644 --- a/sentry_redmine/forms.py +++ b/sentry_redmine/forms.py @@ -114,3 +114,5 @@ class RedmineOptionsForm(forms.Form): class RedmineNewIssueForm(forms.Form): title = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'span9'})) description = forms.CharField(widget=forms.Textarea(attrs={'class': 'span9'})) + issue_no = forms.CharField(max_length=10, widget=forms.TextInput(attrs={'class': 'span9'}), required=False, + help_text='This will link the sentry entry to an existing issue instead of creating a new one.') diff --git a/sentry_redmine/plugin.py b/sentry_redmine/plugin.py index 5b8ab5b..fd20004 100644 --- a/sentry_redmine/plugin.py +++ b/sentry_redmine/plugin.py @@ -73,6 +73,8 @@ class RedminePlugin(IssuePlugin): """ Create a Redmine issue """ + if form_data.get('issue_no'): # link to existing issue + return form_data.get('issue_no') client = self.get_client(group.project) default_priority = self.get_option('default_priority', group.project) if default_priority is None: