The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

How can I tell actual Jira version of a cloud instance for proper createmeta usage?

Richie SR User
September 17, 2020

Hey there!

I'm struggling to find information on what actual jira version cloud instances run. I'd have to use the REST API's createmeta endpoint and should be able to tell whether I should be using the pre-8.4 or the post-8.4 approach to get the required data for projects/issue types.

Is it really my berst option to try one, see if it fails, then try the other? Doesn't seem very productive to me.

I hope there's something more elegant that I didn't find yet.

Thanks,
Richie

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 17, 2020

You don't really care what the Cloud version is.  You can get to it if you really want, via a REST call, but it is of no use to you.  It can change without warning, and it does, frequently.  And it's a string of numbers, little more than a build number, not a Major.Minor.Point style version, so it wouldn't tell you anything about 8.4 or 8.5

The REST API for Server is different to the Cloud REST API.  Not a lot, as they do much the same thing with similar data structures, but you should be reading the Cloud REST API docs, not the 8.4/8.5 stuff for Server.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 17, 2020

Sorry, I should also have pointed to https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/ which is the stable Cloud version (version 3 is available, but in beta at the moment)

If you expand the "issues" section on the left, you should see the "get create metadata" call documented. 

Richie SR User
September 17, 2020

So to be able to support create on whatever version the client wants to use the integration with, I have to be able to support pre-8.4, post-8.4 and cloud versions of the REST API's approach of the createmeta endpoint?

To be honest, the pre-8.4 approach looks the same as the cloud one, so I can probably be fine with branching the create logic only two ways(post-8.4 and pre-8.4/Cloud), right?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 17, 2020

Ahh, I see, you're creating something that wants to talk to "Jira", without caring if it is Cloud, Server or Data Centre (not that you'd really care about Server/DC - they share the same code base).  Technically, they're different products, and while the REST APIs for Cloud and Server  are very similar, they're not quite the same, and may diverge over time, as Cloud and Server continue to diverge.

So, yes, you're right, you will need to code for Cloud, Server and the various server versions, and somewhere make a call to establish which branch to take when the APIs have diverged.  I used Rudy's serverInfo call to ask a Jira whether it was Cloud or Server when I ran into this.

For what it's worth, Atlassian try to keep the REST APIs as stable as possible - it's very rare that a REST call will stop working when a new version of Jira is deployed.  They might add new calls and parameters, but new stuff doesn't affect existing stuff.

Richie SR User
September 17, 2020

Thank you. :)

0 votes
Rudy Holtkamp
Community Champion
September 17, 2020

For cloud you can use 

https://your-domain.atlassian.com/rest/api/3/serverInfo

Which give you

{
"baseUrl": "https://your-domain.atlassian.net",
"version": "1001.0.0-SNAPSHOT",
"versionNumbers": [
1001,
0,
0
],
"deploymentType": "Cloud",
"buildNumber": 100146,
"buildDate": "2020-09-16T22:27:06.000+0530",
"scmInfo": "2252177febf411d5d56f408e8d38dbc0e2a1d5fd",
"serverTitle": "JIRA",
"defaultLocale": {
"locale": "en_US"
}
}

 The buildNumber in combination with the version gives away the complete version you are on.

Richie SR User
September 17, 2020

The problem is, that I can't -for example- use the cloud server's build number for checks like how the createmeta endpoint is working on a given instance.

Pre-8.4(build number: 804001) createmeta seems to be working the same as on my cloud instance(build number: 100146). So comparing them by build numbers or anything is not relevant since the cloud seems to be an 'older' version(in case of the createmeta endpoint) than anything after v8.4.

It seems like(again, judging from how the createmeta endpoint works) the cloud instances are still running a pre-8.4 jira version.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events