Hello all,
I'm trying to make a REST API request using API docs, but I don't understand how to make a request with authentication. In this case, I have follwed this guide, but I don't know how to obtain "client_id" specified in the first step.
What I want to do is:
Therefore, what is the best approach to do this? What I need to make the request autheticated?
Thank you very much.
Regards,
Miguel.
Hi Miguel,
Thanks for reaching out to the community, my name is Nero and I am here to help.
So the client_id you are looking for can be found in the bitbucket settings for your site. This guide can show you how to set up an OAuth consumer if you haven't done so.
Once you have done this you will be able to see your key (the key is the client_id you where missing) and secret on the OAuth settings page:
Additionally, as I am unsure what language/approach you are using I can recommend checking out these bitbucket repos which have a number of examples on both Oauth and OAuth2
OAuth2 Examples (only Java and Javascript currently available)
I hope this helps, however, if you would like some more help with this it would be hand if you could provide some examples of your work so far so I can get a better understanding of any further sticking points you may have.
Best,
Nero
Thank you very much for your response Nero.
The scenario that I want to create is:
* From Jira Server: If the user make an issue transition (for example, from "In progress" to "Done"), and if the issue has a Pull Request associated, automatically merge this PR in a Bitbucket cloud account.
My first approach was doing this with a REST API request, from a script in the transition post-function. This script would make a request, first to obtain Bitbucket credentials, and then make a request to "merge" endpoint, with the JWT token obtained.
While I have done more research, I saw that is possible to make requests from linked applications in Script Runner. But then, I've realized that Jira Server and Bitbucket cloud are linked via DVCS connector. So I've read that is possible to use this plugin directly from a script. Therefore, it's possible to get the PR associated with the issue, but now I need to do more research to see if it's possible to make the merge operation with this PR obtained.
What I want to know is if this last approach is better than the first one, or vice versa.
If you need more information I'll try to be clearer.
Thanks!
Regards,
Miguel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Miguel,
Sorry for the delay in coming back to you. I have read through your response and I do believe that using the native integrations via DVCS is the better option.
I would imagine that in your research you have come across this Connect Bitbucket Cloud to Jira Software Server, but I thought I would link it just in case.
As for the functionality, this page gives a good overview Jira/Bitbucket Integration and you may also find this article useful 6 things you should know before & after integrating Jira Software Server with Bitbucket Server (it is server to server but mostly still applicable when using Bitbucket Cloud)
Do reach out to us again if you have any further questions.
Best,
Nero :D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.