Error connecting MS Teams to Jira Server / Data Center - Rate Limiting enabled.

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

You are able to connect a few times, but not all users from Microsoft Teams to Jira Server / Data Center using the marketplace app, "Microsoft Teams for Jira", and the Teams plugin "Jira Server".

Specifically in the step on Teams using the Jira Server connector, when you are trying to "Authorize in Jira" "Connecting you to Jira", it appears to connect and provides the message, "You've connected to Jira.", but also provides the error, "Unable to reach app. Please try again."

At that point if you try to use the connection with a command such as the find command to find a known Jira ticket, the message says, "Oops something went wrong, please try again." So something in the connection is being blocked.

Environment

Jira Server / Data Center

Diagnosis

After enabling / increasing the logging level below:

1 2 3 4 5 6 org.apache.http com.microsoft.teams.service com.microsoft.teams.utils com.microsoft.teams.OAuth com.microsoft.teams.lifecycle com.microsoft.teams.lifecycle.scheduler

You can identify some occurrences when the connection has been shutdown due to the lack of free connections returning back to Jira:

  • No free connections {s}->[https://jira.xxxx.net:443][null]

  • Available capacity: 20 out of 20 {s}->[https://jira.xxxx.net:443][null]

1 2 3 4 5 6 7 2022-11-18 14:43:04,451+0000 OkHttp https://msteams-jira-server.service.signalr.net/... DEBUG ServiceRunner [o.a.h.impl.execchain.MainClientExec] Cancelling request execution 2022-11-18 14:43:04,451+0000 OkHttp https://msteams-jira-server.service.signalr.net/... DEBUG ServiceRunner [o.a.h.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-24: Shutdown connection 2022-11-18 14:43:04,451+0000 OkHttp https://msteams-jira-server.service.signalr.net/... DEBUG ServiceRunner [o.a.h.impl.execchain.MainClientExec] Connection discarded 2022-11-18 14:43:04,451+0000 OkHttp https://msteams-jira-server.service.signalr.net/... DEBUG ServiceRunner [o.a.h.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 24][route: {s}->https://jira.xxxx.net:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20] … 2022-11-18 14:43:41,147+0000 OkHttp https://msteams-jira-server.service.signalr.net/... DEBUG ServiceRunner [o.a.h.i.conn.tsccm.ConnPoolByRoute] No free connections [{s}->https://jira.xxxx.net:443][null] 2022-11-18 14:43:41,147+0000 OkHttp https://msteams-jira-server.service.signalr.net/... DEBUG ServiceRunner [o.a.h.i.conn.tsccm.ConnPoolByRoute] Available capacity: 20 out of 20 [{s}->https://jira.xxx.net:443][null]

Right after this error comes up:

  • SignalR invoke hub method Callback() with response: {"code":429,"response":"","message":"Something went wrong in Jira Server application."}

1 2022-11-18 14:44:08,334+0000 OkHttp https://msteams-jira-server.service.signalr.net/... DEBUG ServiceRunner [c.m.teams.service.SignalRService] SignalR invoke hub method Callback() with response: {"code":429,"response":"","message":"Something went wrong in Jira Server application."}

Cause

  • The HTTP code 429 stands for Too Many Requests response status code indicating the user has sent too many requests in a given amount of time ("Rate Limiting").

  • It seems that the presented error above means when MS Teams is invoking a callback to Jira, sometimes it seems to be considered as too many requests higher than Jira can support. So in this case, Rate Limiting might be the root cause.

  • That's why the issue might be intermittent, which sometimes it will allow to receive the incoming request from MS Team, but sometimes not.

  • In the Jira MS Teams Official instructions https://www.msteams-atlassian.com/JiraServer/ there is no information if you are using Rate Limiting, so that you do not run into this problem if you have Rate Limiting enabled.

  • Whitelisting the MS Teams app in the Jira advanced settings can fix the problem so that users do not need to be specifically put on the Rate Limiting Exemptions list to use MS Teams.

Solution

Solution I

Allowlisting external applications

Edit com.atlassian.ratelimiting.whitelisted-oauth-consumers

You can allowlist consumer keys, which lets you remove rate limits for external applications integrated through AppLinks. So you may need to whitelist the MS Teams app by adding the OAuth key “OauthKey" to the Jira advanced settings. This “OauthKey" key is entered in the Application Link incoming settings for MS Teams and comes from the Teams connector app configuration.

  1. Find the consumer key of your application.

    1. Go to Administration > Applications > Application links.

    2. Find your application, and click Edit.

    3. Open Incoming Authentication, and copy the Consumer Key.

  2. Allowlist the consumer key.

    1. Go to Administration > System > General configuration.

    2. Click Advanced settings.

    3. Enter the consumer key as the value of com.atlassian.ratelimiting.whitelisted-oauth-consumers. You can enter multiple consumer keys as a comma-separated list.

After entering the consumer key, the traffic coming from the related application will no longer be limited.

Solution II

Allowlisting URLs and resources

Edit com.atlassian.ratelimiting.whitelisted-url-patterns

Jira does also provide a way to allowlist whole URLs and resources on your Jira instance. This should be used as quick fix for something that gets rate limited, but shouldn’t, such as MS Teams. To work around issues like that, you can allowlist the whole resource added by the app so it works without any limits, this way you can make exception of rate limiting for MS Teams application.

Allowlisting URLs and resources

  1. Go to Administration > System > General configuration.

  2. Click Advanced settings.

  3. Find the com.atlassian.ratelimiting.whitelisted-url-patterns property, and enter your URLs as a comma-separated list, for example:

    1 /**/rest/applinks/**,/**/rest/capabilities,/**/rest/someapi
  4. For more info on how to create URL patterns, see AntPathMatcher: URL patterns.

ℹ️ All the possibilities around Rate Limiting in Jira is outlined at this article: Improving instance stability with rate limiting

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.