Hello all, in jira service management for each ticket we require users to declare their organization. Through Jira automation rule we would like to extract the internal jira ID for their organization (I am refering to the auto generated ID that is stored somewhere by Jira).
How can I query or extract that ID? And just out of curiosity where is this table being stored and how else could I access it?
Thank you very much,
-Tom
You can get the ID via the REST endpoint Get organizations, and then you would have to iterate those orgs in order to find the one the user belongs to using the Get users in organization endpoint.
Hey Mikael, thank you for the quick response, do you know how I could extract an access token/bearer token for the request to go through?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Go to id.atlassian.com and log in with the account you want to generate the token for, then go to Security and from here you can generate it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mikael, I have tried generating a token, and even got a web admin to generate a token, however we both get 401 Unauthorized error. Do we need the top admin (i forget the term i think its gov admin) to generate a token for this to work?
Otherwise, is there any way we could access or query this table without a REST call that would still work with Jira automation?
Thank you so much for your help and time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The permission for the Get organizations says anyone can do it, except if you fetch it using the accountid for the users, then you have to be a JSM agent. The 401 error indicate that you are not logged in. Make sure you are including the headers in the web request, like this:
The documentation says to use Bearer, but that is only if you use OAuth authentication in a connect app. Since you are using a user you have to use Basic the email:token, like this: fred@example.com:<token>
I use encode64 to encode the credentials as an extra precaution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mikael, thank you so much for the information!!
This looks very promising. I will let you know how it goes!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Mikael,
thank you again for all of your help and patience with me its much appreciated :)
I am not able to get any data back in the jira automation and I think it is because I am not doing the right Autorization for an API token. I still see a 401 error saying that the Basic authorization is depricated.
I am however able to get data when doing a curl call using my token:
curl -v https://[baseURL].atlassian.net/rest/servicedeskapi/organization --user [myEmail]:[myAPIToken]
how can I translate this into my Jira Automation REST call?
I have tried Authorization: Basic [myEmail]:[myAPIToken] but this gives me 401 error
thank you again for your patience,
Tom Daudelin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, so it looks like you have to encode your email address and token for it to work. I just tried it in my sandbox environment and the validation of the web request was successful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
YOU ARE A LIFE SAVERRR!!!
thank you so much for all of your help!!
I have tried it on my end and it works too!
Thank you so much again :))
Tom Daudelin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.