A while back we were working on improving the performance of the Createmeta REST endpoint. The endpoint was deprecated and we added two new endpoints. But obviously, we couldn't remove the old one right away since that would break the API. The problem was the products (Confluence, Bitbucket, other third-party apps etc.) that integrate with Jira. They are more or less agnostic with regards to Jira versions when they are integrated, meaning they work with a range of Jira versions instead of a one to one version match.
Since we wanted customers to see improvement as soon as possible, the change was released with Jira 8.4. We needed to give the integrated products a way to check whether the new and improved endpoints are available for them to use. After some digging, we found the solution we were after was already available: the capability module.
The Capability module in Atlassian plugins is a very simple module with two fields:
url. When you create a capability module, it is registered and when the
/rest/capabilities endpoint is called the capability you created is returned. The answer of the capabilities endpoint responds with a list of JSON objects. A single entry will look like this:
In a Jira plugin, you can add new capabilities in the
atlassian-plugin.xml. In order to get the above entry in the response, you would need to add the following capability module: