It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can i identify JIRA servers?

Ilya Oct 31, 2016

Is there a retrievable unique identifier for JIRA server? The plugin does receive a data payload which contains clientKey, but how to get it using REST or some other api from plugin-related desktop application? I was thinking about using baseUrl as a reasonable identifier, but what if server moves to another host or changes url? How can i understand which client I am dealing with?

2 answers

1 accepted

2 votes
Answer accepted
Nic Brough [Adaptavist] Community Leader Oct 31, 2016

For Cloud, baseUrl is reasonable - the only way to change a base url at the moment is to buy a new one and then export/import the data. 

For server, ideally, you'd probably want to use the Server ID.  It is possible for admins to hack or clone it, but that doesn't happen a lot.  It's not available to REST though.  I think the best you can do over REST is to look at the server info - https://docs.atlassian.com/jira/REST/server/#api/2/serverInfo

3 votes
Robert Massaioli Atlassian Team Oct 31, 2016

The fact that you use the word clientKey suggests to me that you are writing an Atlassian connect add-on. In this case, you MUST use the clientKey as the unique identifier and NOT the base URL. You may have a method that uses the baseUrl to look up the clientKey (or vice versa) but don't use the baseUrl as your unique identifier for a tenant.

We have documented this:

If the Atlassian product is the calling application: contains the unique identifier of the tenant. This is the clientKey that you receive in the installed callback. You should reject unrecognised issuers.

Source: https://developer.atlassian.com/static/connect/docs/latest/concepts/understanding-jwt.html

In the future, Atlassian might implement this popular issue: https://jira.atlassian.com/browse/CLOUD-7184

If you are using the baseUrl as the unique identifier at the time then your add-on will have a bad time of it.

Nic Brough [Adaptavist] Community Leader Oct 31, 2016

Ahh, thanks Robert.  I've yet to write a Connect add-on, so I've not run into it. 

Robert Massaioli Atlassian Team Nov 01, 2016

It's no problem at all. The question does not even mention Atlassian Connect so my answer might be off the mark; I'm just making a guess here. But yes, for people writing Atlassian Connect add-ons wanting to uniquely identify cloud instances / accounts / tennants then the clientKey is the way to go.

For server your answer is spot on!

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

665 views 7 0
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you