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.
How to set up and validate locally
Enable the GitLab for Jira Cloud app for your instance:
- Go to
/admin/application_settings/general - Expand GitLab for Jira App
- 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