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:Ā 

Is there an easy way to access the BitBucket Rest API from Pipelines

Ashvin Narayanan
Contributor
February 24, 2019

Tried searching for this but couldn't find any resources.

Is there a way to access the Rest API from a Pipelines script without the need for authentication to the API?

Because the way I see it, the build runners run within BitBucket and you've configured the scripts yourself for which you would've needed appropriate permissions anyway. So there's no need for further authentication (or is there?).

My specific use-case: I need to comment on a Pull Request being created with code-coverage results, for which I need to access the Rest API from the Pipelines script.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
StannousBaratheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2019

Hi @Ashvin Narayanan 

Authentication is still required to access the Bitbucket API within Pipelines. You can easily do this however by setting up an App password (see https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html) and adding that password as a secure environment variable (see https://confluence.atlassian.com/bitbucket/variables-in-pipelines-794502608.html) in Pipelines for use within your build script.

Ashvin Narayanan
Contributor
February 27, 2019

Yup that's how I've got it setup at the moment. Just seems like redundant authentication.

Like • Seth Miller likes this
TAGS
AUG Leaders

Atlassian Community Events