Jira Cloud app only editable via API when active

What does this MR do and why?

Integrations that have #manual_activation? set to false can only be activated and deactivated through the UI and not the API.

#472755 (closed)

How to set up and validate locally

Enable the GitLab for Jira Cloud app for your instance:

  1. Go to /admin/application_settings/general
  2. Expand GitLab for Jira App
  3. Enter any string into Jira Connect Application ID and click Save changes

Create a GitLab for Jira Cloud app for a project:

project = Project.first

puts "#{Gitlab.host_with_port}/api/v4/projects/#{project.id}/integrations/jira-cloud-app"

Use the puts output above for the API calls.

Try to create a GitLab for Jira Cloud app integration for the project:

curl --location --request PUT '<OUTPUT OF puts ABOVE>' --header 'Authorization: Bearer <YOUR LOCAL PAT>'

You should get:

{
    "message": "You cannot create the GitLab for Jira Cloud app integration from the API"
}

In a rails console, create an integration for the project.

FactoryBot.create(:jira_cloud_app_integration, project: project)

Try to disable the integration through the API:

curl --location --request DELETE '<OUTPUT OF puts ABOVE>' --header 'Authorization: Bearer <YOUR LOCAL PAT>'

You should get:

{
    "message": "You cannot disable the GitLab for Jira Cloud app integration from the API"
}

Related to #472755 (closed)

Edited by Luke Duncalfe

Merge request reports

Loading