1

My standalone Gitlab has an option for integrating Jira. Gitlab Web UI shows Jira in the list of available integrations under Admin Area > Instance-level integration management.

I would like to enable and configure Jira integration for my newly deployed instance using the gitlab-rails console or REST API, without the WebUI. How can I do this?

Gitlab image version: gitlab/gitlab-ee:16.10.0-ee.0

1 Answer 1

0

this code worked for me:

if jira_integration = Integrations::Jira.first
  puts "post-reconfigure.sh: existing Jira integration found, skip Jira init."
else
  puts "post-reconfigure.sh: no existing Jira integration found, creating new one ..."

  new_jira_integration = Integrations::Jira.new(
    active: true,
    instance: true,
    project_id: nil,
    group_id: nil,
    properties: {
      url: '${JIRA_URL}',
      username: '${JIRA_USER}',
      password: '${JIRA_PASS}',
    }
  )

  if new_jira_integration.save
    puts "post-reconfigure.sh: new Jira integration created successfully."
  else
    puts "post-reconfigure.sh: failed to create new Jira integration."
    puts new_jira_integration.errors.full_messages
  end
end
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.