youngmon/atlassian-qna huggingface dataset:
Adding resolved comment when closing via API
Asked by Ben Hart:

So I can successfully transition an issue in the service desk, to resolved via the API. I cannot however add a closing comment.

Going by the example here: [api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-post](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-post)

They show this:  

```
"comment": {
    "type": "doc",
    "version": 1,
    "content": [
      {
        "type": "paragraph",
        "content": [
           {
             "type": "text",
             "text": "Issue resolved and closed by AAP"
           }
         ]
      }
    ]
  }
```

However nothing is added to the now Closed issue as any sort of comment. I wanted to ask if anyone had a working example of how to add a resolution/closing comment in teh same call as the transition, or should they be separate calls?


Answers:
author: Trudy Claspill
body: Hello [@Ben Hart](/t5/user/viewprofilepage/user-id/5479079)

Is that the full payload you are providing with the API call? If not, can you show us the full payload?

Also, that doesn't match what I see as examples in the referenced documentation.

![Screenshot 2024-05-31 at 11.15.02?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/327264iA87054800D8794CF/image-size/large?v=v2&px=999 "Screenshot 2024-05-31 at 11.15.02?AM.png")

comments: author: Ben Hart
body: Well the full payload is:

```
{
  "transition": {
  "id": "111"
  },
    "comment": {
    "type": "doc",
    "version": 1,
    "content": [
     {
      "type": "paragraph",
      "content": [
      {
       "type": "text",
       "text": "Issue resolved and closed by AAP"
      }
    [
    }
  ]
  }
}
```

However I did initially try and mimic exact what you listed there. (I feel like i should clarify here.. I literally copied exactly the same format as in the example) That generates:

```
"Operation value must be an Atlassian Document (see the Atlassian Document Format)"
```

And trying to find help for that is an exercise in futility.


author: Trudy Claspill
body: I have not tried to use the v3 API for this specifically. v3 is still tagged as being in beta.

Have you tried falling back to using the v2 API?

<https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-transitions-post>


Tags: cloud

jira-service-management

jira-service-management-cloud
New admin is unable to view board
Asked by Sam Bryant:

I have granted another user admin privileges on our ITSM board and she is unable to view anything other than settings. I have made sure she has the same group permissions (she is probably over permissioned at the moment for troubleshooting purposes...). The links I've sent her always take her to the ITSM settings and when we try to go back or click on the board, it constantly redirects her to the settings page instead. We want to go premium but cannot without testing first and this is the only thing holding us back. Any help is greatly appreciated!

Attached is a photo showing an error when I try to force the view of the board. Again, she has all the same permissions as me as far as I can tell. ![image (3).png](https://community.atlassian.com/t5/image/serverpage/image-id/327240iEE00DEE5E1A7F1AE/image-size/large?v=v2&px=999 "image (3).png")


Answers:
author: John Funk
body: Hi Sam - Welcome to the Atlassian Community!

Just because a user is a Jira admin, it does not mean they have direct access to everything in the system. They still need to be added to the Permission Scheme for each project. I usually have the Jira Admins group assigned to the Administrators project role by default on creating a new project.


author: Christian
body: Hi Sam

It appears to me that this other user does not have access to the ITSM project. Board privileges and Project/issue privileges are separate. She can have access to the board, but if she doesn't have access to the project or issues on the board, the board will be empty. Given the error she is getting, she likely doesn't have any access to the ITSM project, making it appears as if it doesn't exist. I would look at the project settings on the ITSM project to see if she has access.

Best,

Christian


Tags: cloud

jira-service-management

jira-service-management-cloud
manage multilevel hierarchy to manage repository
Asked by Michele:

What is the best approach to manage a hierarchy of the repositry? For example i want to organize my repository in firmware and software "folder" 1? level and then under firmware i would have some differents repository for various projects organized into differents projects. I thought to use differents workspaces to have firmware and software workspace, but i have to buy two License to extend the free version to the Premium version. How could i have this hierarchy into only one workspace?


Answers:
author: Saxea _Flowie_
body: Hi [@Michele](/t5/user/viewprofilepage/user-id/5338223),

Wouldn't Bitbucket [projects](https://support.atlassian.com/bitbucket-cloud/docs/create-a-project/) and groups allow you organise without having to have separate workspaces? E.g Have Software and Firmware projects and their respective repositories?

comments: author: Michele
body: Hi Saxea, Thank you for the answer, i would a situation type

software - repo1 (project 1)

-repo2 (project 1)

-repo3 (project 2)

firmware -repo4 (project3)

-repo5 (project4)

-repo6 (project 4)

-....

tools -repo7

-.... etc

with three workspaces this is possibile but i couldn't buy two workspace.

how could i organise this?

regards

Michele


author: Saxea _Flowie_
body: Maybe you could do something like:

- MyWorkspace (workspace)

- software-1 (project)

- repo1

- repo2

- software-2 (project)

- repo3

- firmware-1 (project)

- repo4

- firmware-2 (project)

- repo4

- repo6

and so on...

Having said that, the organization depends on what you are trying to achieve. E.g. shared configs and permissions? or is it based more on a logical structure?


author: Michele
body: but within project software 1 , i have the necessity to group various repository to share (i.e.) differents permissio or organize better various repository (i.e. group differents repository for differents clients), thanks


Tags: bitbucket-cloud

cloud
Notifications for pushes made by the admin
Asked by Software delta:

HI,  
I would like to receive all types of notifications for pushes made by the admin. Which setting should I change or activate?

Thank you


Answers:
author: Patrik S
body: Hello [@Software delta](/t5/user/viewprofilepage/user-id/4796557) and thank you for reaching out to the Community!

While it's not possible to filter the notification for a particular user, you can **Watch**a repository to receive notification email for any commit that is pushed to it.

To start watching a repository, you can follow the below steps :

1. Navigate to the repository you want to start watching
2. Click on the **three-dot icon** button the the right top side of the page
3. On the drop-down, select **Manage notifications** option
4. You will be prompted to select which notification you want to enable. You can select **Commits** to receive notifications about any new commit in the repository :   
   ![Screenshot 2023-10-12 at 3.58.27 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/286027i27C1E5ED2BA80D0D/image-size/large?v=v2&px=999 "Screenshot 2023-10-12 at 3.58.27 PM.png")

To learn more about how bitbucket notifications work, the following article might also be of help :

* [Manage email notifications for watched objects](https://support.atlassian.com/bitbucket-cloud/docs/manage-email-notifications-for-watched-objects/)

Hope that helps!

Thank you, [@Software delta](/t5/user/viewprofilepage/user-id/4796557) !

Patrik S


Tags: bitbucket-cloud

cloud
Login using docker login
Asked by Roel:

I am having a local docker file created and I want to pusch it to the bitbucket repo.

When running docker login - u UserNAme -p Password bitbucket.org I am getting the error. Error response from daemon: login attempt to <https://bitbucket.org/v2/> failed with status: 404 Not Found

Iam really stuck on how to get mijn local docker image to my bitbucket repo

Thanks in advance


Answers:
author: Patrik S
body: Hello [@Roel](/t5/user/viewprofilepage/user-id/5338388) and welcome to the Community!

Bitbucket Cloud is designed to function as a git repository, facilitating the storing and versioning of your files and code. As such, you can utilize Bitbucket to push your files and code.

However, it appears there might be some confusion regarding the possibility of pushing Docker images as well. Unfortunately, Bitbucket Cloud does not support this function. Docker images require a docker registry for storage, such as Dockerhub.

To utilize Docker Hub or a similar docker registry service, you will need to use the '*docker login*' command. This will enable you to log in to your docker registry and subsequently push your Docker images to it.

However, if what you want to push to Bitbucket Cloud is actually the *Dockerfile* ( and not the docker image itself), then you can follow the below steps :

1. Create a repository in Bitbucket Cloud (or use an existing one you have)
2. [Clone the repository](https://support.atlassian.com/bitbucket-cloud/docs/clone-a-git-repository/) locally using your system terminal   
   For HTTPS :

   ```
   git clone https://{username}:{app_password}@bitbucket.org/{workspace}/{repository}.git
   ```

   <br />

   For SSH

   ```
    git clone git@bitbucket.org:<workspace>/<repository>.git
   ```

3. Add the *Dockerfile* inside the local clone of the repo
4. Commit the file using the following git commands :

   ```
   git add Dockerfile
   git commit -m "adding a Dockerfile"
   ```

5. Push the changes to Bitbucket Cloud

   ```
   git push
   ```

This should make the Dockerfile available in your bitbucket repository.

Hope that helps! Let me know in case you have any questions.

Thank you, [@Roel](/t5/user/viewprofilepage/user-id/5338388) !

Patrik S


Tags: bitbucket-cloud

cloud
API to check whether a PR can be merged or not?
Asked by Siddharth Agrawal:

As part of the CI/CD pipeline, we want to validate whether a PR passes configured merge checks and is not in any conflict. I went through the cloud Rest documentation, but didn't find any api.

I see bitbucket ui makes a api call to /merge-restriction to get this info. Is there a similar api to consume?

If not what other alternatives I have to check whether a PR can be merged or not?


Answers:
author: Patrik S
body: Hello [@Siddharth Agrawal](/t5/user/viewprofilepage/user-id/5338350) and welcome to the Community!

I'm afraid that for pull request merge check status in particular, Bitbucket Cloud currently doesn't expose a public API endpoint. We do have an open feature request to make this information available on the API, which you can find below :

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

I would suggest you to add your **Vote** there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a **Watcher** in case you want to receive first-hand updates from that ticket.

For getting the PR diff conflicts though, our development team is working on building a direct endpoint to fetch that information, but in the meanwhile you can use the [Get Pull Request API](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-get) endpoint to get the PR, and use the source and destination commit data to construct a [direct diffstat request](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get) which will return the conflict status as part of the object.

Hope that helps! If you have any questions, please let us know.

Thank you, [@Siddharth Agrawal](/t5/user/viewprofilepage/user-id/5338350) !

Patrik S


author: Saxea _Flowie_
body: Hi [@Siddharth Agrawal](/t5/user/viewprofilepage/user-id/5338350),

Depending on what you are trying to do you should be able to achieve with [Flowie](https://flowie.app), and if not, I'm happy to discuss and possibly add support for it.

Are you trying to run a pipeline only if certain conditions are met? E.g. only build after a review is complete?


Tags: bitbucket-cloud

cloud
How to generate 4096 Byte SSH Keys
Asked by Amit Sharma:

I want to use Bitbucket SSH Keys to Acquia Cloud. But Acquia Cloud allows only 4096 bit keys and bitbucket doesn't generate 4096 bit keys.

In this situation, I created another key which is 4096 bit and added it to Acquia Cloud.

Now in the bitbucket pipeline, I need to use a newly generated private key so that CI server can authenticate itself while pushing the code to Acquia Cloud.

I followed <https://support.atlassian.com/bitbucket-cloud/docs/use-multiple-ssh-keys-in-your-pipeline/> to implement this.

Using these keys I tried to do SSH in the Acquia cloud server in the pipeline but got the error:

USER@HOST: Permission denied (publickey).

Please suggest


Answers:
author: Patrik S
body: Hello [@Amit Sharma](/t5/user/viewprofilepage/user-id/5337457) and thank you for reaching out to Community!

You should be able to use your own keys in Pipeline by selecting the option **Use my own keys** under **Repository Settings \> SSH keys**page :

![Screenshot 2023-10-12 at 12.11.47 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/285983iD3F10B14223DA241/image-size/large?v=v2&px=999 "Screenshot 2023-10-12 at 12.11.47 PM.png")

By selecting that option, you'll be prompted to provide both the private and public keys you have created locally. Right below on the same page, you can also provide your SSH server host IP address/URL to fetch the fingerprint, so it will be automatically added to the *known_hosts* file inside the build container.

Once the keys are configured in the settings page, they will be automatically made available inside the build container for subsequent builds, so you won't need to export them as in the article you shared.

Could you try following that route and let us know how it goes?

In case you are still facing issues, we kindly ask you to share the full SSH command you are executing (you can redact private information such as server name/IP/username) and the full log output you are receiving.

Thank you, [@Amit Sharma](/t5/user/viewprofilepage/user-id/5337457) !

Patrik S

comments: author: Amit Sharma
body: Awesome, better approach to handle the same. Thank you very much for all the help [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)


author: Patrik S
body: You're very welcome [@Amit Sharma](/t5/user/viewprofilepage/user-id/5337457) !

Feel free to reach out to Community if you ever need help :)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
How to trigger webhook only for a specific branch
Asked by Vineet Kumar:

Is it possible to trigger webhook only when code is pushed to a specific branch like master. Webhook should not trigger if code is pushed to other branches.


Answers:
author: Saxea _Flowie_
body: Hi [@Vineet Kumar](/t5/user/viewprofilepage/user-id/4294051),

I'm afraid it's not possible. The webhook would need to filter the branches it is interested in.

comments: author: Vineet Kumar
body: Would be great if we have this feature, currently we are using Gitea as scm, where we have this option for filtering on branch for webhook.

![Gitea_webhook.png](https://community.atlassian.com/t5/image/serverpage/image-id/285798i7DCCBE7EB6D3630B/image-size/large?v=v2&px=999 "Gitea_webhook.png")


author: Saxea _Flowie_
body: [@Vineet Kumar](/t5/user/viewprofilepage/user-id/4294051) I see... Are you looking at migrating away from Gitea and considering Bitbucket cloud?


author: Vineet Kumar
body: Yes, we are looking for same.


author: Saxea _Flowie_
body: [@Vineet Kumar](/t5/user/viewprofilepage/user-id/4294051) May I ask you, why from your perspective, Gitea is not good fit currently for your company?


author: Adam Holmes
body: Hi, did you find a solution to this? Thanks, Adam


Tags: bitbucket-cloud

cloud
Can't Remove Pull Request after delete of source repo ???
Asked by Md_ Rifatul Islam:

Can't Remove Pull Request after delete of source repo ???


Answers:
author: Patrik S
body: Hey [@Md_ Rifatul Islam](/t5/user/viewprofilepage/user-id/5118617) and thank you for reaching out to Community!

Currently, it's not possible to delete pull requests in Bitbucket Cloud. We do have an open feature request to implement this functionality :

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

We encourage you to add your **Vote** there, to bring the feature more visibility and also help our product managers to understand the interest. You also have the option to mark yourself as a **Watcher**, so you get notified whenever there's any update on that feature.

Thank you, [@Md_ Rifatul Islam](/t5/user/viewprofilepage/user-id/5118617) !

Patrik S


Tags: bitbucket-cloud

cloud
Problem login to bitbucket.org
Asked by ioannis pomonis:

Hello there,

When iam tryting to login on bitbucket.org using my email ipomonis@comitech.gr i get

"You may run into this issue when you use specific browsers or add-ons that hide the referer header for id.atlassian.com and other Atlassian sites. Check for these and then try logging in again."

I have tried to login using multiple browser , clear cache etc.

Can you please help me?

Best Regards,

Yiannis


Answers:
author: Ben
body: G'day!

The reason you are receiving that error message is because your account is inactive, it has been in a DORMANT state since 2018.

I have just re-activated your account so you will be able to login now, please clear the cache in your browser and attempt to login again :)

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Danijel Marjanovic
body: Thank you for the prompt answer!

Unfortunately, the issue still persists.

I deleted cookies, cleared session storage and restarted browser.

New attempt to login results in the same error.

Is there anything else that needs to be done?


author: Ben
body: Hi [@Danijel Marjanovic](/t5/user/viewprofilepage/user-id/5432480)

This is a different email address you've just replied with, I've activated this account as well - please attempt to login using the email address associated with this account.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: unknown-hosting-type
Can a cache be used instead of artefacts?
Asked by Andrei Dascalu:

When I am using a cache:

1) can I specify a cache to be used by a pipeline entirely (eg: it will be automatically used by all steps)

2) if 2 steps use the same cache and step 1 makes changes to the cached data, will step 2 receive the updated cache or the cache state under which the pipeline originally started?

Thanks


Answers:
author: Patrik S
body: Hello [@Andrei Dascalu](/t5/user/viewprofilepage/user-id/4961047) , thank you for reaching out to Community!

Caches in Bitbucket Pipelines are defined at the step level, meaning that for each step you want to use cache, you will need to define it directly in the step

```
pipelines:
  default:
    - step:
        caches:
          - node
        script:
          - npm install
```

There's not currently a global option to enable cache for all the steps.

As for your second question, just bring some context on how Bitbucket pipeline caches work, when you define a cache in Bitbucket pipeline, it will generate a cache the first time the build is successful.

Once the cache is generated, it will be available for the next 7 days. During that 7-day period, any new build you trigger will download the **previously generated cache** during the **Build Setup** phase.

After 7 days, the cache will be automatically deleted, and a new fresh cache will be generated in the following successful build. You can expedite the cache refresh by manually deleting the cache in the **Pipelines** page \> **Cache** button in the top right \> click on the trash icon.

Another option is to use smart caches, also known as [caching with file-based cache-keys](https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies/#Caching-with-file-based-cache-keys) , where the cache will be automatically refreshed based on the file(s) in the repository that is(are) defined as the key. Any changes to those key file(s) would result in a new cache.

You can also find more details about pipeline caches in the following article :

* [Cache dependencies - Bitbucket Pipelines](https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies)

Hope that helps! Let me know in case you have any questions.

Thank you, [@Andrei Dascalu](/t5/user/viewprofilepage/user-id/4961047) !

Patrik S


Tags: bitbucket-cloud

cloud
Force download of ipynb
Asked by Karan Vaswani:

I am storing ipynb Jupyter notebook files. I want to use the link to the file to auto download to the computer. What change do I need to make to the URL to force that?


Answers:
author: Ben
body: G'day Karan!

Welcome to the Bitbucket Cloud Community :)

May I confirm first - do you want to download files from your **repository source** ? Or from the **Downloads** section that is found in **Repository Settings \> Downloads**?

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Karan Vaswani
body: From the repository source


author: Ben
body: Hi Karan,

Unfortunately, there is no effective method for downloading specific groups of files from the repository source using a URL alone as authentication needs to take place, therefore using our /2.0/repositories API is the recommended method.

**For example** - here is a CURL command that will download a given file from your repository source. It will work with any extension of file that is present in your repository. You would need to specify your username and [App Password](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/) (for auth purposes) as well as the workspaceID, repositoryslug, branch and filename:

```
curl -L -u <username>:<AppPassword> https://api.bitbucket.org/2.0/repositories/<workspaceID>/<repositoryslug>/src/<branchname>/<filename>.<ext> --output <destinationfilename>.<ext>
```

**However,** by taking a look at the URL used in the API query, you can modify this slightly to have a static link that will open in a browser outside of the API (as long as you have an actively logged-in session with Bitbucket Cloud). The problem here is - if it is a text-based file this will preview in the browser by default, whereas only non-text files will download automatically. This is why I believe it would not work for your Jupyter notebook files specifically:

```
https://bitbucket.org/!api/2.0/repositories/<workspaceID>/<repositoryslug>/src/<branchname>/<filename>.<ext>
```

Hope this helps, [@Karan Vaswani](/t5/user/viewprofilepage/user-id/5337938)

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-server

server
How to create/add ssh-keys inside the repository via REST API?
Asked by Sugar Ray Tenorio:

I tried this API endpoint:  
POST <https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_sig}/ssh-keys>  
data = {  
"label": "new-ssh-key",  
"key": "ssh-rsa blah blah"  
}  
and authenticated using Oath2.  
The response is this:  
"{\\"type\\": \\"error\\", \\"error\\": {\\"message\\": \\"Resource not found\\", \\"detail\\": \\"There is no API hosted at this URL.\\\\n\\\\nFor information about our API's, please refer to the documentation at: [https://developer.atlassian.com/bitbucket/api/2/reference/\\](https://developer.atlassian.com/bitbucket/api/2/reference/\)"}}"  
what is the correct endpoint? I can't find it on the REST API docs.


Answers:
author: Syahrul
body: G'day [@Sugar Ray Tenorio](/t5/user/viewprofilepage/user-id/2185984)

I believe the endpoint you are looking for is the following:

[Add a repository deploy key](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deploy-keys-post)

This should add the SSH key on the repository level. The location of this in UI is under Repository settings \> Access keys

I hope this helps

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud