Service template accepts invalid Jira api url, which leads to broken projects

Summary

One can save an invalid Jira API URL when creating a JIRA Service Template. When new projects are created, they will error with a 500.

Steps to reproduce

  1. Create a JIRA service template with a JIRA API URL that has a "trailing slash" and save.

  2. Create a new project, an MR and link to a JIRA project from the MR. A 500 is thrown.

  3. Go to project settings > integrations > JIRA and try to "Test settings and save"

  4. An error is thrown (this is expected but should be handled better).

What is the expected correct behavior?

The parameters should be checked before being propagated to new projects.

Note that this will affect all projects and become critical if Allow to apply service template to all projects is rolled out.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Results of GitLab application Check

Possible fixes

Related customer issue: https://gitlab.zendesk.com/agent/tickets/131306 (Internal use only)

Assignee Loading
Time tracking Loading