@@ -34,6 +34,12 @@ class GitLabOptionsForm(forms.Form):
3434 help_text = _ ('Enter your repository name, including namespace.' ),
3535 required = True )
3636
37+ gitlab_labels = forms .CharField (
38+ label = _ ('Issue Labels' ),
39+ widget = forms .TextInput (attrs = {'placeholder' : 'e.g. high, bug' }),
40+ help_text = _ ('Enter the labels you want to auto assign to new issues.' ),
41+ required = False )
42+
3743
3844class GitLabPlugin (IssuePlugin ):
3945 author = 'Pancentric Ltd'
@@ -62,6 +68,7 @@ def create_issue(self, request, group, form_data, **kwargs):
6268 url = self .get_option ('gitlab_url' , group .project )
6369 token = self .get_option ('gitlab_token' , group .project )
6470 repo = self .get_option ('gitlab_repo' , group .project )
71+ labels = self .get_option ('gitlab_labels' , group .project )
6572 if repo .find ('/' ) == - 1 :
6673 repo_url = str (repo )
6774 else :
@@ -76,7 +83,7 @@ def create_issue(self, request, group, form_data, **kwargs):
7683 except Exception as e :
7784 raise forms .ValidationError (_ ('Error Communicating with GitLab: %s' ) % (e ,))
7885
79- data = {'title' : form_data ['title' ], 'description' : form_data ['description' ]}
86+ data = {'title' : form_data ['title' ], 'description' : form_data ['description' ], 'labels' : labels }
8087
8188 proj = gl .Project (id = repo_url )
8289 issue = proj .Issue (data )
0 commit comments