Accessing bitbucket repository settings / links via API - bitbucket

Id like to enable/disable the "Require issue keys in commit messages" setting on repositories via the rest API. This can be done on the site by going to Repository Settings > Links. I cant find any examples on this on the documentation page https://developer.atlassian.com/cloud/bitbucket/rest/intro/ but hope its possible.

You have the correct API documentation for Bitbucket Cloud.
Unfortunately, there is no API Endpoint to change this repository setting.

Related

Credentials not available in Jenkins Pull Request Builder plugin

I have added global credentials in Jenkins.
However when I try to add then in my Pull Request builder plugin configuration, they don't seem available.
Any suggestions?
Using Jenkins 2.303.1
(the arrow on the left of the Add drop-down does not do anything)
The instructions in the GitHub pull request builder plugin documentation says that you need to "select Kind -> Secret text". Based on the icon in your credentials list, I think you have defined a credential type "Private key".
The pull request builder likely uses the GitHub API's to perform many of its operations. GitHub API's rely on a username and a personal access token. They generally do not support a private key as the credential.
Define a secret text credential as described in the online help.

ghprbActualCommitAuthorMail returns wrong mail address

I am using the GitHub pull request builder plugin in Jenkins to make pull requests on GitHub automatically trigger Jenkins jobs.
I am using GitHub Enterprise and when I try to get the values of environment vars ghprbActualCommitAuthor and ghprbActualCommitAuthorMail, I get incorrect values:
ghprbActualCommitAuthor : GitHub Enterprise
ghprbActualCommitAuthorEmail : noreply#github.***.com
Please help, thanks!
This behavior is seen in GitHub Enterprise when users commit changes directly using the web UI or they have not set their email addresses.
According to GHE support:
This is by design, since the commit is actually done by the GitHub Enterprise instance. This is because we do not impersonate users when creating commits.
You can fix this by ensuring that users make commits only through the Git clients using their own SSH credentials or Personal Access Tokens.

Addition of webhooks in Gitlab

I want to do automatic build in Jenkins when code gets pushed into the Gitlab.
For the same doing webhooks configuration in Gitlab, but getting error :
Url is blocked: Requests to the local network are not allowed.
Even not able to do the activity mentioned in the image :
I am not able to go to the admin area.
if you have the gitlab server locally
from doc
This behavior can be overridden by enabling the option “Allow requests to the local network from web hooks and services” in the “Outbound requests” section inside the Admin Area > Settings (/admin/application_settings/network):
url to the entire article here
Use the root login and check the outbound option, you should be good.
Let me know if you get any other error.
I had faced the same issue yesterday, but all good now.

Bamboo Bitbucket integration

Bamboo and bitbucket are two pieces from the same vendor and there should be no problem integrating those two with each other, but I have a weird situation.
Here is what i get when trying to add bitbucket repo to my Bamboo.
See attached screenshot.
I'm pretty sure my repo is public and I use correct bitbucket user account name.
Thanks in advance.
I have installed BAMBOO to AWS using Java script provided by Atlassian
At the end it gave me a web UI links as on following screenshot .
It worked, however some functionality was blocked by XSRF (that is not enabled by default in Atlassian products).
Works fine when I use native Bamboo URL (HTTP and port 8085) instead on HTTPS.
Be careful with that... I just wasted about 2 days trying to fix something that didn't have to be fixed at all.
Have you linked your Bitbucket repo to Bamboo server. If not see this https://confluence.atlassian.com/bamboo/linking-to-another-application-360677713.html
May be this can help.

Bitbucket: How to create a list of issues from multiple repositories?

We have several repositories on BitBucket. For every repository we
have the issue tracker enabled. For our progress reports I would like
to be able to see all issues from all related repositories in one
overview.
Is this possible and how can it be done?
Thanks,
Paul
Bitbucket has an API. You could quickly put together a script (or webpage using JSONP) calling:
https://api.bitbucket.org/1.0/repositories/USERNAME/REPOSITORY/issues/
for each repository? (Replacing USERNAME and REPOSITORY with appropriate values)
For something more advanced you could query the USER, get all their repositories, then iterate.
I needed the same thing today so I made the following python script available here on github.
The two API call URLs you need are
https://bitbucket.org/api/1.0/user/repositories/
https://bitbucket.org/api/1.0/repositories/{owner}/{slug}/issues/
You'll have to authenticate with your BitBucket credentials which I did using the python requests library:
response = requests.get(url, auth=HTTPBasicAuth(_USERNAME, _PASSWORD))

Resources