youngmon/atlassian-qna huggingface dataset:
Create pull request via API: destination repository cannot be changed?
Asked by joel:

Hello,

I'm trying to create a PR via the API, where the source is my own fork, the the destination is the main repository.

I get this error:

```
{"type": "error", "error": {"fields": {"destination": ["destination repository cannot be changed"]}, "message": "destination: destination repository cannot be changed"}}
```

Here's my command:

```
curl \    
  -X POST \
  -H "Content-Type: application/json" \
  -u username:app_password\
    https://bitbucket.org/api/2.0/repositories/username/repo-fork/pullrequests \
  -d '{      
  "title": "test",      
  "description": "testing automated PR",      
  "source": {        
    "branch": {          
      "name": "test"        
    },        
    "repository": {          
      "full_name": "username/repo-fork"        
    }      
  },      
  "destination": {        
    "branch": {         
       "name": "master"        
    },        
    "repository": {          
      "full_name": "username2/repo"        
    }       
  },       
  "reviewers": [ { "username": "user" } ],       
  "close_source_branch": false    
}'
```

Why does this editor remove all my newline breaks when I paste code from my editor? Anyway... any ideas how do I make a PR from a fork to the main repository?

Thank you!


Answers:
author: Theodora Boudale
body: Hi [@joel](/t5/user/viewprofilepage/user-id/3143170) ,

When you create a PR from a fork to the main repo, this PR is created in the main repo (and the fork is specified in the source).

Therefore, the API URL in the call should be the one of the main repo. I believe the issue with your call is that the URL of the fork is used and then you attempt to change the destination repo in the data.

You can change the URL and omit the "repository" part in the destination, like this:

```
curl \ 
 -X POST \
 -H "Content-Type: application/json" \
 -u username:app_password\
   https://bitbucket.org/api/2.0/repositories/username2/repo/pullrequests \
 -d '{ 
 "title": "test", 
 "description": "testing automated PR", 
 "source": { 
   "branch": { 
      "name": "test" 
    }, 
    "repository": { 
       "full_name": "username/repo-fork" 
     } 
 }, 
 "destination": { 
    "branch": { 
       "name": "master" 
     } 
 }, 
"reviewers": [ { "username": "user" } ], 
"close_source_branch": false 
}'
```

Is this something that works for you?

Kind regards,  
Theodora

comments: author: joel
body: Yes it works, thank you!


Tags: api

bitbucket-cloud

cloud

pull-request
how to add drop down menu in README file
Asked by Shashikala Hansamail:

How to add a drop-down menu for the README file.what is the code for that


Answers:
author: Ashwini_More _miniOrange
body: Hi Shashikala,

Please refer to the below code for adding a dropdown menu in readme file.

```
<details><summary>Dropdown Heading</summary><br>Choice 1
<br> Choice 2
<br> Choice 2
<br></details>
```

comments: author: Shashikala Hansamail
body: thank you [@Ashwini_More _miniOrange](/t5/user/viewprofilepage/user-id/3782947),

but it does not work. are there any tags before type your code


author: Ashwini_More _miniOrange
body: Hi Shashikala,

Sorry to hear that.

No, It does not require any other tags. Is it possible for you to share the file that you are working on?


author: hugogogo
body: hello [@Ashwini_More _miniOrange](/t5/user/viewprofilepage/user-id/3782947)

the code above doesn't work for me neither ? it's in a REAME.md file, in a bitbucket repo, i tried first to put only your code, and then to add a title (## title), the title get formated but still not the dropdown menue

it appear in a one line code :

\`\<details\> \<summary\>Dropdown Heading\</summary\> \<br\> Choice 1 \<br\> Choice 2 \<br\> Choice 2 \<br\> \</details\>\`

do you have an idea why it doen't work ?


Tags: bitbucket-server

server
Bit Bucket log integration with SIEM
Asked by Naveen Sharma:

Hi Team,

We want to monitor BitBucket Cloud security logs in our SIEM Solution.

Is there a way to extract/integrate audit and security logs for SIEM integration?

We are using AlienVault Anywhere as SIEM.

I could see some documentation about APIs, but could not understand clearly.

Can you please help?

Regards,

Naveen


Answers:
author: Theodora Boudale
body: Hi Naveen and welcome to the community.

I'm afraid that Audit Log info in Bitbucket Cloud is not available via API at the moment, nor is it possible to export it.

We do have feature requests in our issue tracker both for making Audit Log info available via API, and also for the ability to export it in several formats:

* <https://jira.atlassian.com/browse/BCLOUD-13176>
* <https://jira.atlassian.com/browse/BCLOUD-14419>

If you'd be interested in these features, I would suggest that you add your vote (by selecting the **Vote for this issue** link in each feature request) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the **Start watching this issue** link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy here <https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html> and any updates will be posted in the feature requests.

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Unit tests in pipelines that can run on local network
Asked by Nathaniel Strong:

My team's code runs on a local network and we can only access our databases on that private network. We are working to implement continuous integration and delivery. Is there a way to automate unit testing for merging to the main branch where the tests can run in the local environment?


Answers:
author: Gonchik Tsymzhitov
body: Looks like you need to have use the premium subscription with whitelisting to extend a private network

<https://support.atlassian.com/bitbucket-cloud/docs/control-access-to-your-private-content/>

comments: author: Nathaniel Strong
body: Gonchik, Thanks for the response. The issue is not so much setting rules but rather having tests that require a connection to databases on a local network.


author: Gonchik Tsymzhitov
body: Okay, regarding process.

Here need to know your gitflow :)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

continuous-delivery

unit-test
Pull request pipeline not running on specified branch
Asked by Jonathan Hutchison:

This pipeline config isn't working for PR's on the development branch. In fact pull-requests: '\*' doesn't seem to work either, for what it's worth. Any thoughts?

```
image: node:alpine

definitions: 
  steps: 
    - step: &build 
        name: Build 
        caches: 
          - node 
        script: 
          - yarn 
          - yarn build


pipelines: 
  branches: 
    development: 
      - step: *build 

  pull-requests: 
    development: 
      - step: *build 
    production: 
      - step: *build
```


Answers:
author: ktomk
body: The YAML looks wrong to me. Perhaps the online validator can help: <https://bitbucket-pipelines.prod.public.atl-paas.net/validator>

comments: author: Jonathan Hutchison
body: No, that was just my poor formatting when pasting the yaml into the editor. (I've updated it now). Let's assume for the sake of discussion that the config is correct, which my tests have been.


author: ktomk
body: Yes, lets do this. What do you mean it does not work? Lets assume it is not running for the pull-request against develop (the PR is to be merged against develop) but the pipeline is running when you push the develop branch, correct?


author: Jonathan Hutchison
body: That is correct


Tags: bitbucket-pipelines
What is default port of api bitbucket / innersource ?
Asked by Daniel Lins:

I'm try get commits from the company repository with url like this below and don't work.

Is there a standard port for a bitbucket api?

curl -u \<myuser\>:\<mypta\> [https://innersource.\<company\>/rest/api/1.0/projects/\<project\>/repos/\<repository\>/commits/]()


Answers:
author: Nic Brough -Adaptavist-
body: Welcome to the community Daniel!

Yes, there is a standard port, it's 443. That's the standard port for SSL, and almost all software assumes when you say "https" and do not specify a port, 443 is implied.

I don't think the port is a problem in your command. What is the error message you are getting?

comments: author: Daniel Lins
body: Hi Nic thankyou.

Its works now!

Novice error, my vpn was not active this was the reason.


author: Nic Brough -Adaptavist-
body: Ah! Glad you found it.   

VPN connection is where I fall over a lot too, not just forgetting that I might need it, but assuming I'm using the right one when I'm blatantly not. I think the only day-to-day computing thing I get wrong more often is my complete inability to find the "mute" button on zoom, discord and slack!


Tags: bitbucket-cloud

cloud
How does source code mounting for Docker containers work?
Asked by jandyman:

I'm just getting started implementing CI/CD for embedded ARM code using Bitbucket. I've learned about Docker containers and have successfully found a suitable public image and have successfully done a headless build on my local machine with Docker Desktop, the embedded toolset being Eclipse for ARM (STM32CubeIDE)

In order to do that, I had to create a bind mount for the source code. I'm assuming that when using Bitbucket Pipelines, that something similar is done with the branch(es) being processed. Can someone explain how this works with Bitbucket Pipelines? Without that understanding, I fear I'll fall into pothole trying to get the CI/CD stuff working.


Answers:
author: Theodora Boudale
body: Hi [@jandyman](/t5/user/viewprofilepage/user-id/743511) ,

By source code, I assume that you are referring to the source code of the repository where Pipelines is running? (If not, please feel free to correct me/clarify).

For every step of a Pipelines build, a Docker container starts with the image you have specified in your bitbucket-pipelines.yml file. If you haven't specified one, the image atlassian/default-image:latest will be used.

If you have builds that run on branches, then this branch will be cloned in the Docker container with a default depth of 50 (you can change the depth in your yml file). Then the commands of the script in your yml file will be executed in the container, in the directory where the branch of the repo was cloned.

Builds for pull requests run a bit differently, the source branch is cloned in the docker container and then it is merged with the destination branch. Then, the build is executed on the merged code. Please note that no merge is actually happening in the original Bitbucket repo, the code is merged only in the clone in the Docker container where the build runs.

If you run custom builds (triggered manually) or if you manually trigger a pipeline for a certain commit, the repo is cloned and then a git checkout is done for the commit the pipeline is running for, so the repo is in a 'detached HEAD' state.

I'm not sure how you've made your tests locally, but you can also check this guide we have for debugging Pipelines builds locally with Docker, which specifies options for simulating the memory restrictions in Pipelines:

* <https://support.atlassian.com/bitbucket-cloud/docs/debug-pipelines-locally-with-docker/>

If you have any questions, please feel free to let me know.

Kind regards,  
Theodora


Tags: bitbucket-pipelines

bitbucket-cloud

cloud
Public DockerHub image not caching (or just slow pull times)
Asked by Valtteri Puonti:

Hi,

According to the answer here: <https://community.atlassian.com/t5/Bitbucket-questions/Caching-a-public-Docker-Hub-image/qaq-p/1045777> BitBucket Pipelines has an internal Docker Image cache that is used for public Docker Hub images.

I think that is not working as expected, because when I was pulling a custom Image (3GB) from our company's repo took, the build setup took \~2mins. After trying out a public image from Docker Hub (circleci/android:api-30), the build setup still took \~2mins on back to back attempts!!!

So: Does BB Pipelines have caching for public Docker Hub images or not? And why was pulling an image from my company's repo as fast as using Docker Hub's public image?

Thanks,

Valtteri Puonti


Answers:
author: ktomk
body: Hi Valtteri, welcome to the Atlassian Community.
> Does BB Pipelines have caching for public Docker Hub images or not?

I can not speak for Atlassian, and don't know about any specific changes since [Apr 16, 2019](https://community.atlassian.com/t5/Bitbucket-questions/Re-Caching-a-public-Docker-Hub-image/qaq-p/1060293/comment-id/41121#M41121) .

From what I know, there is caching of public images. It is not a mirror thought, so if the image was not yet cached, it will take its time.
> And why was pulling an image from my company's repo as fast as using Docker Hub's public image?

That sounds like the network speed from the registries and sounds like that the public image was not cached or the cache not fully populated across all nodes.

What I don't know:

* If using the local cache (Docker build cache) is hindering the public cache
* If the changes to the public Docker registry by Docker itself back around October 2020 lead to changes and which changes for the public cache.

References:

* [Docker Hub rate limits in Bitbucket Pipelines (October 30, 2020; by Raul Gomis)](https://bitbucket.org/blog/docker-hub-rate-limits-in-bitbucket-pipelines)


Tags: bitbucket-pipelines

cache

docker

image

public
How to get a link for Bitbucket Pipelines build artifacts to publish it on Confluence?
Asked by Ivan Belyakov:

I would like to have a link to the latest binary that was built using Bitbucket Pipelines, so I could post this link in a Confluence article, so that teammates can always download the latest build artifact.

Even better if I could provide on Confluence a list of links to builds of different branches/tags.

I can not just forward them somehow to Downloads section of Bitbucket, since they must not have access to Bitbucket, only to Confluence.

<br />

How can I achieve that?


Answers:
author: Ivan Belyakov
body: Alright, I figured it out.  

1. Create a page on Confluence. I also used *File list* template on this page for better visual experience. See the page id in the URL after */pages/*
2. Create a token for accessing REST API - <https://id.atlassian.com/manage-profile/security/api-tokens>
3. This is a link for a guide to add/update attachments - <https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-api-content-id-child-attachment-put> . *'id'*is your page id from step 1 above.


author: Theodora Boudale
body: Hi Ivan,

Bitbucket Pipelines artifacts can only be accessed by users with access to the repo where the build is running. If users don't have access to the repo, they cannot download artifacts.

If Confluence REST API provides an endpoint for uploading a file in a Confluence page, you could include in your Pipelines build an API call that will upload the binary you want to a Confluence page. Are you using a Confluence Cloud instance or a Server one (self-hosted)?  

Kind regards,  
Theodora

comments: author: Ivan Belyakov
body: Hi Theodora, thank you for your response. I am using Confluence Cloud. How do I post the artifact to Confluence page? I couldn't find any information on this


author: Ivan Belyakov
body: Thank you for REST API hint, I posted an answer below


author: Theodora Boudale
body: Hi [@Ivan Belyakov](/t5/user/viewprofilepage/user-id/3020377) ,

I am really sorry for not replying earlier, I somehow missed the notification of your reply from 23rd February.

I had asked whether you use Confluence Server or Cloud so I can check for the appropriate API endpoint, but it looks that you have found it already.

Thank you for posting it in your reply, and please feel free to let me know if you need anything further.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

confluence
User not licensed
Asked by haa:

The user can login to bitbucket via the web interface (also shown on Admin-\>Users) but when he tries to clone via TortoiseGIt on Windows there is an error not licensed:

Cloning into ....

fatal: remote error: Not licensed

git exit code 128

**Admin-\> Licensing**

* User limit: 50
* Licensed users: 31

How to resolve this


Answers:
author: haa
body:     ...yes same thing on the command line.

    git clone https://haa@git.fidesintra.net/scm/jira/fides-data.git

    did the trick, where USER is the usernamehttps://haa@git.fidesintra.net/scm/jira/fides-data.git

    git config --global user.name "..."git config --global user.email "..."

    might have worked as well? 

    https://haa@git.fidesintra.net/scm/jira/fides-data.git


author: Martin Bayer _MoroSystems_ s_r_o__
body: HI [@haa](/t5/user/viewprofilepage/user-id/4234178) I do not use TortoiseGit, but did you try to Clone manually in Git Console? Is it working or does it display the same error?


Tags: bitbucket-server

server
I am trying to change a repository to another workspace
Asked by H?lio Augusto Sab?ia Moura:

I am trying to change a repository to another workspace but after requesting the transfer the following message appears on the repository configuration screen "Repository transfer in progress" followed by "... tranfered this repository to ... 18 hours ago" and the transfer does not materializes. Can someone give me a clarification, please?


Answers:
author: Theodora Boudale
body: Hi [@H?lio Augusto Sab?ia Moura](/t5/user/viewprofilepage/user-id/4270176) ,

When you transfer a repository, an email is sent to the administrators of the workspace that you are transferring to. One of the admins needs to follow the link in this email and accept the transfer request, in order for the transfer to be completed.

Are you an admin of the workspace you have transferred the repo to, and if so, have you received an email about the transfer?  
If you're not admin of that workspace, can you check with one of the admins and see whether they have received an email about the transfer request?

Kind regards,  
Theodora

comments: author: VisionsLive Admin
body: Thank you.  
I had no idea about an email being sent. It makes sense, but there is no indication in the UI that this step needs to happen.


author: Hana Ku?erov?
body: Hi [@H?lio Augusto Sab?ia Moura](/t5/user/viewprofilepage/user-id/4270176) ,

welcome to the Atlassian Community!

I would recommend you to contact official Atlassian support. It seems to me something went wrong and somebody from Atlassian needs to investigate it.


Tags: bitbucket-cloud

cloud

repository
Modifying the View of a Jira Advanced Roadmaps Gantt Chart Displayed in Confluence
Asked by Jeff Davis:

How do I change what columns are displayed in the Jira Advanced Roadmaps Gantt chart on my Confluence page? I want to show Start Date/End Date, not Target start/Target end, as my teams use the former two fields in their Jira issues. Thank you!


Answers:
author: Florian Bonniec
body: Hi [@Jeff Davis](/t5/user/viewprofilepage/user-id/4094804)

The view use in the Confluence macro is the one you have when you create the Share Link. So, you can create the view you want, create the share link and add the link in the confluence macro.

Regards

comments: author: Jeff Davis
body: [@Florian Bonniec](/t5/user/viewprofilepage/user-id/495589) thank you. That worked.

In case anyone is unclear what I did, I deleted the roadmap in the Confluence page, went back to Jira, ensured the roadmap displayed the information I needed it to display, recreated the link for Confluence from the Share option, and added it to Confluence.


Tags: advanced-roadmaps

confluence-server

jira

jira-server

macro

server
Is it possible to use Conflucence Automation Action "Publish Page" and indicate the page contents?
Asked by Dylewski,Rafal:

Confluence Automation documentation says that I can use Publish Page action in my Confluence Automation, indicating the page location, title, and optionally a template. Is there a chance to specify also the page contents?

Use case: I wanted to receive some data via the webhook trigger, publish a page, and add to the page contents the data points from the webhook body. Is it feasible?

Thank you!


Answers:
author: Trev Angle
body: Hi [@Dylewski,Rafal](/t5/user/viewprofilepage/user-id/5073696), at this time the only way to include a body with the published page is to use a template. This could change in the future though! Feel free to submit a suggestion here or vote for existing similar suggestions: <https://jira.atlassian.com/secure/Dashboard.jspa?selectPageId=10440>

Note: another potential workaround is to use the "Send web request" action to send a POST request to the Confluence API: <https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-post>


Tags: cloud

confluence-cloud
Creating Child Tabs in one of the Child Tabs
Asked by Bhanu Jansi:

I created 6 child tabs in a confluence page. One of those child tabs require additional 2 tabs within the Child Tab page. When i edit the outer child tab and insert a child tab and refer the outer child tab as a parent tab i keep getting an erro

Childtabs  
We can't find the parent **4. M6: Release**. Please try again.  
It did work at a moment and when I renamed the tab it started throwing this error. there might be some tiny catch that Im missing


Answers:
author: Rodrigo
body: Hello [@Bhanu Jansi](/t5/user/viewprofilepage/user-id/5164262), welcome to the Atlassian Community!

It sounds like you might be using an app for your ChildTabs solution. Would it be, by chance Navitabs by bitvoodoo?

If that assumption of using an app is correct, it would be a good idea to contact the app vendor directly to get precise feedback. Should this issue appear while using Navitabs for Confluence, then you can reach the support portal via this link:

<https://jira.bitvoodoo.ch/servicedesk/customer/portal/2>

With friendly regards  
Rodrigo


Tags: cloud

confluence-cloud

tab
How to insert Jira Issue information into Confluence
Asked by graham.pinnock:

I would like to have a Confluence Page that displays the ID, Summary, Description and Priority of each Jira Issue in my project in a table - one row per JIRA ticket. The purpose is to print this in word or pdf to share with stakeholders.

If I insert a link to the JIRA ticket, I get some information but this does not print well. There is an option to create a JIRA report but this is not dynamic and looks terrible.

Does anyone have any cool ways to share JIRA issues in confluence with stakeholders?

Many thanks


Answers:
author: Mikael Sandberg
body: Hi [@graham.pinnock](/t5/user/viewprofilepage/user-id/5130059),

Welcome to Atlassian Community!

You can use the [Jira macro](https://support.atlassian.com/confluence-cloud/docs/insert-the-jira-issues-macro/) to do this, it will add a list of Jira issues based on a filter that you define. And you can also configure which fields should be visible in the table.

comments: author: graham.pinnock
body: Many thanks, that was a big help :)


Tags: cloud

confluence-cloud