can't switch to instance default jira integration using REST API

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Our self hosted instance has 500+ projects and they were all created using the now-deprecated service template for jira integration. So, 100% of our projects have custom, per-projects settings that happen to all be the same. It's impossible to manage without the REST API.

As part of the 14.0 upgrade, we converted to jira integration, configured at the instance level. This will be great for managing when the jira service account's credentials are rotated except that all the projects still have their own isolated settings and the REST API doesn't seem to do the same thing as selecting "Use default settings" in the project-level jira integration UI's drop down.

Steps to reproduce

  1. Run gitlab 13.x or earlier with a project, e.g. id=42, that was created with a service template for jira integration
  2. Configure jira integration at the instance level in preparation of the removal of the deprecated service templates feature
  3. Upgrade to gitlab 14.0.4
  4. Request the REST API endpoint DELETE /api/v4/projects/42/services/jira

What is the current bug behavior?

In the UI for the project's Settings -> Integrations, Jira is not checked as Active.

What is the expected correct behavior?

In the UI for the project's Settings -> Integrations, Jira is checked as Active.

When clicking into the active Jira integration for the project, the "Default settings are inherited from the instance level" field drop down shows Use default settings

Workaround

When the Jira integration on the project is not active (after requesting the DELETE API endpoint), trying to set it up through the UI to use default settings fails with the error "Password can't be blank".

However, if I first configure the project for custom settings then I can use the UI in the project's settings to switch it to use default settings. That seems to work because then the UI's dropdown shows Use default settings. However, I won't know for sure until the next time the password changes and I observe if changing it at the instance level fixes jira integration for that project.

There's no way I'm going to use the UI for 500+ projects.

UPDATE 2022-11-03: See #337128 (comment 1158264230) for a workaround

Edited by 🤖 GitLab Bot 🤖