My Jira app needs to be compatible with different versions of Jira.
So I need to get the current version of Jira in order to known which request I can make via the REST API.
I found two solutions : call AJS.Meta.get(‘version-number’) or JIRA.Version.isGreaterThanOrEqualTo().
Both work but I have similar warnings.
For AJS.Meta:
The global object AJS.Meta is deprecated. Please use require([“jira/util/data/meta”]) instead.
Unfortunately, the require() method on the client-side works differently from the CommonJS require statement. When executed in the browser it is an async operation and it takes a callback function that will return the object you are fetching. Which means that to use it in this code example, you will have to write: