Jira integration is broken on project settings
Summary
After upgrading to Gitlab 11.6.5 EE we can no longer enable Jira integration on projects when using its service template.
Steps to reproduce
- Create a service template for Jira integration, with a password
- Try to enable it on a project
- Get
Validation failed. Password can't be blank
What is the current bug behavior?
Jira integration cannot be enabled with the default service template. If it was enabled before and you try to disable and then re-enable again, you will be asked for a required password (i.e. https://gitlab.com/gitlab-org/gitlab-ee/blob/v11.6.5-ee/app/views/shared/_field.html.haml#L27 The value is blank so the field is required)
What is the expected correct behavior?
If the service template already has a password it should not be asked again.
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Possible fixes
This line of code is always evaluated to false: https://gitlab.com/gitlab-org/gitlab-ee/blob/v11.6.5-ee/app/controllers/concerns/service_params.rb#L74 It is not considered a Hash. Here there is a String representation of its value:
{"active"=>"1", "api_url"=>"", "jira_issue_transition_id"=>"2", "merge_requests_events"=>"1", "password"=>"", "url"=>"https://<our_general_instance>/jira", "username"=>"<username>", "commit_events"=>"1"}
Since this if is never true, the password is never removed from the list, and keeps asking for a value to enter.