JIRA Integration Doesn't Work

Various teams in our company are trying to use the base JIRA integration with their projects without success.

We are currently using our company JIRA server which is running version 8.5.4 which is publicly accessible. Our GitLab instance is 12.10.5.

When I go to setup JIRA integration with a project, I enter the URL, transition IDs, my username (for testing), and my API key. Then when I click Test settings and save changes, everything seems good. I don’t get any errors. Yet, when I create a branch and push a commit with a JIRA ticket ID, I don’t see comments on the ticket as would be expected nor do I see transitions when I merge to close a ticket.

When go to the admin area and check the integration_json logs, I see errors for the integration. Here is one example:

{
  "severity": "ERROR",
  "time": "2020-05-21T14:12:12.405Z",
  "correlation_id": "c5b9789f-9ec0-49cb-bc4e-1dd746a1a024",
  "service_class": "JiraService",
  "project_id": 123,
  "project_path": "my/project",
  "message": "Error sending message",
  "client_url": "https://my.jira.com",
  "error": {
    "exception_class": "JIRA::HTTPError",
    "exception_message": "Internal Server Error",
    "exception_backtrace": [
      "lib/gitlab/error_tracking.rb:63:in `track_and_raise_exception'",
      "lib/gitlab/jira/http_client.rb:16:in `request'",
      "app/models/project_services/jira_service.rb:306:in `create_issue_comment'",
      "app/models/project_services/jira_service.rb:294:in `block in send_message'",
      "app/models/project_services/jira_service.rb:361:in `jira_request'",
      "app/models/project_services/jira_service.rb:291:in `send_message'",
      "app/models/project_services/jira_service.rb:274:in `add_comment'",
      "app/models/project_services/jira_service.rb:192:in `create_cross_reference_note'",
      "app/services/system_notes/issuables_service.rb:131:in `cross_reference'",
      "app/services/system_note_service.rb:206:in `cross_reference'",
      "app/models/concerns/mentionable.rb:188:in `block in create_cross_references!'",
      "app/models/concerns/mentionable.rb:187:in `each'",
      "app/models/concerns/mentionable.rb:187:in `create_cross_references!'",
      "app/workers/process_commit_worker.rb:44:in `process_commit_message'",
      "app/workers/process_commit_worker.rb:34:in `perform'",
      "lib/gitlab/with_request_store.rb:7:in `with_request_store'",
      "lib/gitlab/sidekiq_daemon/monitor.rb:49:in `within_job'"
    ]
  }
}

On the GitLab server, I see this in the exception log:

{
  "severity": "ERROR",
  "time": "2020-05-21T14:12:12.403Z",
  "correlation_id": "c5b9789f-9ec0-49cb-bc4e-1dd746a1a024",
  "extra.server": {
    "os": {
      "name": "Linux",
      "version": "#1 SMP Thu Feb 27 23:49:15 UTC 2020",
      "build": "4.14.171-105.231.amzn1.x86_64",
      "kernel_version": "Linux f8e46cb569c4 4.14.171-105.231.amzn1.x86_64 #1 SMP Thu Feb 27 23:49:15 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux"
    },
    "runtime": {
      "name": "ruby",
      "version": "ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]"
    }
  },
  "extra.sidekiq": {
    "class": "ProcessCommitWorker",
    "args": [
      123,
      4,
      {
        "id": "e11cbd788c47812f0fc977c343ab72453c8f6870",
        "message": "JIRA-1001 Update .gitlab-ci.yml for testing",
        "parent_ids": [
          "b0a24fc0b2dfb5a45f0994b919f703e0d1249678"
        ],
        "authored_date": "2020-05-21 14:12:07 +0000",
        "author_name": "Gregory McDaniel",
        "author_email": "gregory.mcdaniel@infor.com",
        "committed_date": "2020-05-21 14:12:07 +0000",
        "committer_name": "Gregory McDaniel",
        "committer_email": "gregory.mcdaniel@infor.com"
      },
      false
    ],
    "retry": 3,
    "queue": "process_commit",
    "jid": "252907a5b91c10fc9a4ebd5f",
    "created_at": 1590070332.084284,
    "meta.user": "gmcdaniel",
    "meta.project": "my/project",
    "meta.root_namespace": "my",
    "meta.caller_id": "PostReceive",
    "correlation_id": "c5b9789f-9ec0-49cb-bc4e-1dd746a1a024",
    "enqueued_at": 1590070332.0868227
  },
  "extra.response": "\u003chtml\u003e\r\n\u003chead\u003e\u003ctitle\u003e500 Internal Server Error\u003c/title\u003e\u003c/head\u003e\r\n\u003cbody bgcolor=\"white\"\u003e\r\n\u003ccenter\u003e\u003ch1\u003e500 Internal Server Error\u003c/h1\u003e\u003c/center\u003e\r\n\u003c/body\u003e\r\n\u003c/html\u003e\r\n",
  "exception.class": "JIRA::HTTPError",
  "exception.message": "Internal Server Error"
}

I’ve verified that I can post a comment on the ticket on the server GitLab resides using curl and the same user and API key. When I go to gitlab-rails c I can verify that posting the comment fails but I can also confirm that GitLab can get all the information about the ticket from JIRA. So it is specifically related to posting comments and transitioning (POST calls) versus GET calls to JIRA.

EDIT: Apparently transitions work intermittently.

Can anyone provide any insight as to why comments and transitions don’t work but the rest of the integration seems valid?

I’ve obtain logs from our Jira admins and it only shows GET API calls for the issue but no POST calls. Still lost as to why GitLab is unable to comment or transition an issue with Jira.