youngmon/atlassian-qna huggingface dataset:
Get latest sprint end date from a group of stories
Asked by Michael Byers:

Running latest version of Jira DataCenter.

This is a good starting point: [How to update a story's target start and end dates based on the sprint dates using Jira Automation \| Jira \| Atlassian Documentation](https://confluence.atlassian.com/jirakb/how-to-update-a-story-s-target-start-and-end-dates-based-on-the-sprint-dates-using-jira-automation-1189790988.html)

But trying to get the latest sprint end date from a group of stories in an Epic. Reading a single date works, but adding the date.max does not work: {{issue.sprint.last.endDate.jiraDate date.max}}


Answers:
author: Bill Sheboy
body: Hi [@Michael Byers](/t5/user/viewprofilepage/user-id/5199214) -- Welcome to the Atlassian Community!

First thing, I am using Jira Cloud, not Server/Data Center, and so my answer is based on what I know about automation rules.

The Server/Data Center version has the ability to bulk-handle issues for a branch or scheduled trigger with JQL: <https://confluence.atlassian.com/automation/run-a-rule-against-issues-in-bulk-993924653.html>

When you do that, the {{issues}} smart value is available to try to find the latest (last) one.

Kind regards,  
Bill

comments: author: Michael Byers
body: Also tried with {{issues}} (which does return the set) but **date.max** does not seem to work with sprint dates. For now, I added another IF comparison to keep the largest date in a temp variable.


author: Bill Sheboy
body: Perhaps also try these expressions to check the date without text formatting as jiraDate:

{{issues.sprint.last.endDate.max}} to check one sprint value per issue, or

{{issues.sprint.endDate.max}} to check all possible sprints for each issue (in case issues were in multiple sprints.


Tags: data-center
How do I stop automation to create a duplicate ticket if it already exists?
Asked by Abhishek:

Let me define the use case:  

We get change requests/suggestions from our clients and the CSM team creates a ticket with this change request on a project called 'CONS'  

The product team reviews the 'CONS' ticket and decides if we need to take up these change requests/suggestions. If we decide to take the task, we move the ticket to 'Selected for development' and also decide the teams, who have their own different project boards, that will need to work on it.  

I want the automation to create a duplicate ticket in individual team boards so that the different teams can work on it. I also want these duplicate tickets to be linked to the main 'CONS' ticket.  

I was able to achieve this with the automation shown in the screenshot attached. But there was a flaw, any time I edited the 'team responsible' field, automation would again create a duplicate ticket.  

For example:  
When Status=selected for development AND Team responsible selected = 'WEB' and 'DESIGN'  

Then two duplicate tickets are created, one in WEB and another in DESIGN board, both of which are linked to the CONS ticket  

If I accidentally remove DESIGN from the team responsible field, the automation would run again and create another WEB ticket which was already there.  

Any help on this is appreciated!   
Thanks.

![Screenshot 2023-04-18 at 3.34.05 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/252435iC3AAAD47AFA36E33/image-size/large?v=v2&px=999 "Screenshot 2023-04-18 at 3.34.05 PM.png")


Answers:
author: Bill Sheboy
body: Hi [@Abhishek](/t5/user/viewprofilepage/user-id/5073657) -- Welcome to the Atlassian Community!

Is this a project scope or a global/multi-project scope rule?

* If this is project scope rule, you could add an "indicator" to the trigger issue, such as a custom field or comment, specifying the cloned-to teams. And then use rule conditions to prevent adding duplicates once already created.
* If this is a multi-project/global scope rule, you could instead check for the existence of the issue in the target clone-to project, and only clone if it is not found.

Kind regards,  
Bill

comments: author: Abhishek
body: Hi [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313), I did it and I was able to figure it out.  

Thank you so much.


author: Abhishek
body: For anyone who is facing the same issue, I am posting an image below of how I was able to fix this.  

![Screenshot 2023-04-20 at 6.30.41 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/252951iC62BF9E37DAE32E7/image-size/large?v=v2&px=999 "Screenshot 2023-04-20 at 6.30.41 PM.png")
how to write message for send to slack and with smart value for grouping assignee name
Asked by Achmad Rifki:

I want to write message automation and send message to slack,

I have write

Task rifki

\<{{issue.toUrl}}\|\*{{issue.key}}\* {{issue.summary}}\>  
Team: {{issue.components.name}}  
Assignee: {{issue.fields.assignee.displayName}}  
Status: {{issue.status.name}}

but now, I have problem, all of message not grouping

my expecatation

Task Rifki

1. XXXX

2. XXXX

3. XXX


Answers:
author: Bill Sheboy
body: Hi [@Achmad Rifki](/t5/user/viewprofilepage/user-id/5109781)

What do you mean by "grouping"? Are you expecting one message or did you want multiple messages?

If you want one message...are you using Jira Cloud or Jira Server/Data Center?

* Jira Cloud:
  * You could use the L[ookup Issues action](https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues) to gather the results as a set, and output a single Slack message. To do this...
    * remove the JQL from your trigger to have it only based on frequency of run,
    * use the JQL with the Lookup Issues Action, and
    * reference the {{lookupIssues}} smart value in your message
* Jira Server/Data Center:
  * You could use the [bulk-handling feature](https://confluence.atlassian.com/automation/run-a-rule-against-issues-in-bulk-993924653.html) of scheduled triggers (or branches) to treat the issues as a set for the message. To do this...
    * set the option for bulk handing in your trigger,
    * and use the {{issues}} smart value in your message. Note this one is plural as it is a set of issues, not just one {{issue}}

Kind regards,  
Bill


author: Mauricio Heberle
body: Could you please screen shot your rule?

comments: author: Achmad Rifki
body: ![Screenshot 2023-04-18 at 10.16.04.png](https://community.atlassian.com/t5/image/serverpage/image-id/252365iBED84A190C428D42/image-size/large?v=v2&px=999 "Screenshot 2023-04-18 at 10.16.04.png")

[@Mauricio Heberle](/t5/user/viewprofilepage/user-id/4973359)


Tags: slack

smart-value
Stuck: Bitbucket Clone Repository in VSCode Dev Container because terminal doesn't take 'yes' input
Asked by exciteresearch:

![Screenshot 2024-05-23 014611.png](/t5/image/serverpage/image-id/325917i134B6172F8282413/image-size/large?v=v2&px=999 "Screenshot 2024-05-23 014611.png")  
"Log" Terminal is locked for input so I cannot enter 'yes' to clone repository into the devcontainer build. This causes the build to fail.

<br />

Does anyone have a solution?  

Windows 11, WSL2, VSCode devcontainers.


Answers:
author: Theodora Boudale
body: Hi [@exciteresearch](/t5/user/viewprofilepage/user-id/1134643) and welcome to the community!

Looking at the screenshot you shared, it looks like the git clone command runs in a container. Before the git clone command runs, the known_hosts file from

```
C:\Users\<your_user>\.ssh\known_hosts
```

gets copied in the container to

```
root/.ssh/known_hosts
```

The issue may be resolved if you simply save Bitbucket's host keys in the file **C:\\Users\\\<your_user\>\\.ssh\\known_hosts** on the computer where this is running.

You can find Bitbucket's host keys here:

* <https://bitbucket.org/site/ssh>

You can copy the content on that page and paste it into **C:\\Users\\\<your_user\>\\.ssh\\known_hosts**, save the file and then perform whatever action you performed when you got this error.

Regarding VS Code's terminal not accepting input, this may be a limitation of VS Code. You will need to reach out to the product's support team to find out. However, ensuring that Bitbucket's host keys are in **C:\\Users\\\<your_user\>\\.ssh\\known_hosts** (so that they get copied into the container) will most likely solve the issue.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Summing up the value of a custom field into the parent issue
Asked by Charlie Naylor:

Hello,

I have been looking at various posts about using automation to sum up fields into a parent issue, and I just can't get it to work and I am not sure why.

When the automation runs, it sums the parent to 0 regardless as to what I set the children to.

<br />

Is anyone able to advise as to what I am missing here?

Thanks in advance

My automation is as below:  
![2023-04-18_12-58-58.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/252458iF1B4E7DBF72003CC/image-size/large?v=v2&px=999 "2023-04-18_12-58-58.jpg")


Answers:
author: Callum Carlile _Automation Consultants_
body: Hi [@Charlie Naylor](/t5/user/viewprofilepage/user-id/5117588) , welcome to the Atlassian Community!

Try setting this smart value to {{lookupIssues.customfield_11286.sum}} (I assume this is the custom field ID for your Annual Voice reduction custom field?)

comments: author: Charlie Naylor
body: Hi Callum,   
Thanks very much - I tried that too, and it doesn't complete either unfortunately. Anything else I can try?


author: Callum Carlile _Automation Consultants_
body: I've just tried this out myself and have replicated what you are seeing with the parent values being set to zero. It seems as though using 'parent' in the lookup will only work when using the 'Parent' branch type, and similarly using "Epic Link" in the lookup will only work with the 'Epic (Parent)' branch type. So:

If you are setting these points on a subtask and want to sum them to the parent issue, you will need to change your branch to just use Parent rather than Epic (parent).

If you are setting these points on a regular issue and want to sum them to the parent *Epic*, you will need to change your lookup JQL to use "Epic Link" = {{issue.key}}


author: Charlie Naylor
body: Works! Thank you


author: Sean Saxon
body: I'm running into the same issue, and no matter what I do, the custom_field in the parent also resets to 0.

I'm using {{#=}}{{lookupIssues.customfield_14478.sum\|0}} + {{lookupIssues.customfield_14474.sum\|0}}{{/}} as my lookup.

I am also using "For: Parent" in my branch, as I know Epic (Parent) is being deprecated.

Very frustrating as this seems so basic, yet failing to sum correctly.


author: Rich
body: [@Charlie Naylor](/t5/user/viewprofilepage/user-id/5117588)I had success using this approach.

![Screenshot 2023-04-18 at 10.59.52 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/252514iBE604E72736A81E8/image-size/large?v=v2&px=999 "Screenshot 2023-04-18 at 10.59.52 AM.png")

comments: author: Charlie Naylor
body: Thanks - I used a different approach that works but that's good to know
Can we automate the sync and is there something that changed in the merging rules?
Asked by Ian Dorion:

Greetings.  

We have recently notice some changes in Bitbucket behaviour.  

1. Merging rules that was working before are no longer working, for instance we have been able to merge some PR when the requirements have not been met. Requirements like 2 approvals minimum, no request changes present are no longer applied and we have been able to merge. We are investigating on our side how this happened.  

2. Is there a way to prevent a merge if the repo is not synchronized with the destination branch. Or even better, could we automate the synchronization when we merge? We have notice that it was easy to overlook the sync status and commit a regression when we merge a branch that is not synchronized.  

Thank you!


Answers:
author: Ian Dorion
body: For no.2. I have found that we can use the pipeline to sync the branches on a merge.  

Still investigating on the no.1  

<br />

We are also wondering if the CodeOwners plugin might interfere with the default set of rules?

comments: author: Ben
body: Hi [@Ian Dorion](/t5/user/viewprofilepage/user-id/5505294)

The [Pull Request UI has changed recently](https://bitbucket.org/blog/new-pull-request-experience) so this may be why it appears to be behaving differently:

* **Previously,** the merge button would display as **grey** if not all merge checks had passed - this was regardless of whether or not merge checks were enforced (if not enforced, you could still perform the merge despite the button showing grey)
* **Now** , the merge button displays as **blue** if the PR is able to be merged. So if merge checks haven't passed, but they're not enforced - you can still theoretically merge the PR. Even with this change, a dialogue box displays before the merge is completed informing the user that checks have not passed.

The only way to prevent merges from occurring when checks have not passed is to [enforce the merge checks](https://support.atlassian.com/bitbucket-cloud/docs/suggest-or-require-checks-before-a-merge/) however this requires a plan upgrade as it is a **Premium** feature.

Hope this helps, please let me know if I have misunderstood your query.

Cheers!

- Ben (Bitbucket Cloud Support)


author: Ian Dorion
body: Thanks [@Ben](/t5/user/viewprofilepage/user-id/4537226)!


author: Ben
body: Not a problem [@Ian Dorion](/t5/user/viewprofilepage/user-id/5505294) - welcome to the Bitbucket Cloud community! :)


Tags: bitbucket-cloud

cloud
Changesets condition with Fast-Forward
Asked by RazvanTodea14:

We have a step in our pipeline to run the seed data only in case some files changed under the seed directory.

The pipelines run based on the branches (release, staging, master). Everything works as expected if the merging strategy of the PR is squashed. (**squash feature-branch -\> release** , **squash hotfixbranch -\> staging)** , but in case the merging strategy is fast-forward (**fast-forward release -\> staging**) the changes under the seed directory are not detected and the run seed step is skipped.

Am I missing something here or this is expected behavior?


Answers:
author: Theodora Boudale
body: Hi [@RazvanTodea14](/t5/user/viewprofilepage/user-id/5505250) and welcome to the community!

This is expected behavior only if the last commit of the source branch does not include any changes in the seed directory.

In a pull-requests pipeline, all commits are taken into account, and if you provide an **includePaths** list of patterns, the step or stage will be executed when at least one commit change matches one of the conditions. For other types of pipelines (including the **branches** pipelines), only the last commit is considered.

With the squash merge strategy, the commits of the source branch are squashed into one, and if that commit has changes in the seed directory the pipeline will run. However, if you have multiple commits merged into the destination branch with the fast-forward strategy, only the changes in the last commit will be taken into account. Please see our documentation here:

* <https://support.atlassian.com/bitbucket-cloud/docs/step-options/#Changes-that-are-taken-into-account>

We have a feature request to take into account all commits:

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

You can add your vote to it if you'd be interested in that feature.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
How to ignore error in pipe?
Asked by Vi Minh Ngh?a:

I'm using Jira Transition pipe to automatically update Jira issue status. But when there is error while the pipe runs the whole step fails. Jira transitioning is just an automation task. It should not fails the whole build. I want to be able to deploy even if a pipe or a step fails.


Answers:
author: Vi Minh Ngh?a
body: Nvm I should have used after-script


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

jira-transition

pipe

step
Require to find all empty repos
Asked by Dani Rubin:

Hi I have recently done a migration to Bitbucket (Data Centre) version.

Problem is we are finding arbitrary empty repos.

I am looking for a way to isolate those repos that are empty and recopy them over.

In particular looking for a list of repos that have zero commits or size = 0.

I tried looking at the Postgres database, but those tables are not very user intuitive.

Any assistance in this regard will be appreciated.

Dani


Answers:
author: Aman Shrivastava
body: Hi Dani,  

Repositories are originally stored on the file system and the database only keeps track of a repository's size when a specific job is executed by Bitbucket for that repository. As a result, the size of each repo may not be present in the database.  

Having said that, we have a KB article on [How to find the size of a repository hosted on Bitbucket Server and Datacenter](https://confluence.atlassian.com/bitbucketserverkb/how-to-find-the-size-of-a-repository-hosted-on-bitbucket-server-and-datacenter-1063551644.html) that consists of an SQL query to determine the size of the repositories.

Regards,  
Aman


Tags: bitbucket-data-center

data-center
Does Bitbucket support ASP.Net CICD Pipelines? or It only supports ASP.Net Core CICD Pipelines?
Asked by Muhammad Khurram:

Does Bitbucket support ASP.Net CICD Pipelines? or It only supports ASP.Net Core CICD Pipelines?


Answers:
author: Theodora Boudale
body: Hi Muhammad and welcome to the community!

Pipelines builds that run on Atlassian's infrastructure support only ASP.Net Core. Pipelines currently run on a Kubernetes cluster of Linux Docker hosts, so we're limited to running .NET Core applications on these hosts (the ASP.Net framework requires Windows).

However, if you have a Windows server where you can run Pipelines builds, you can use a self-hosted Windows Runner:

* <https://support.atlassian.com/bitbucket-cloud/docs/runners/>
* <https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-windows/>

Runners allow you to run Pipelines builds on your own infrastructure, you will be able to see Build logs on the Pipelines page of the Bitbucket repo, and you won't be charged for the build minutes used by your self-hosted runners.

Please feel free to reach out if you have any questions.

Kind regards,  
Theodora

comments: author: Muhammad Khurram
body: Thank you so much! :)


author: Theodora Boudale
body: You are very welcome, please feel free to reach out if you ever need anything else!


Tags: bitbucket-cloud

cloud
Bug: "Files Change" count is missing until you click on "Files Change" tab while reviewing PR
Asked by Justin:

Steps to reproduce:  

1. Open a PR for review

2. check the "Files Change" tab, it does not contains the count of files changed

![Screenshot 2024-05-24 145236.png](https://community.atlassian.com/t5/image/serverpage/image-id/325809i1F28DA2F80792949/image-size/large?v=v2&px=999 "Screenshot 2024-05-24 145236.png")

3. Click on the "Files Change" tab. Observe the files change count.

![Screenshot 2024-05-24 145457.png](https://community.atlassian.com/t5/image/serverpage/image-id/325808i7C2966454C6FB42B/image-size/large?v=v2&px=999 "Screenshot 2024-05-24 145457.png")


Answers:
author: Dave Parrish _Atlassian_
body: Hey [@Justin](/t5/user/viewprofilepage/user-id/5505072) ? It's Dave with the Bitbucket team. Thanks so much for reporting this! It's a known issue that we are actively working on a fix for. Publicly tracking it here:

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


Tags: bitbucket-cloud

cloud
list the changes in a PR api is not working
Asked by ravi.nagayaswanth:

Currently, I am using app password for authentication.  
when I use below Api: it is working and i am able see the PR information  
<https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id>}

but when i use the below Api, just by adding "/diff" to get the changes in the PR, i am receiving 'Response status code does not indicate success: 404 (Not Found).'  

<https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diff>

or   
<https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstat>  

Can you help me with this


Answers:
author: Ulrich Kuhnhardt _IzymesCo_
body: According to the [BB Cloud API spec](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-diffstat-get-response) the request returns a 302 to a [repository diffstat.](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get)

1. Check if you can see the exact PR in the browser, you may not have access to the repo.

2. If you have access in the browser check your app-password scopes are sufficient to see repo and pull requests.

3. Send the request again via curl or postman and see if you get a 302 response with a redirect location.

4. If you use postman, let it follow the redirect, if you use curl run the same request with the '-L' flag

Let me know how you go.


Tags: bitbucket-cloud

cloud
Bitbucket Pipelines really slow in build setup
Asked by Ren? Dyhr:

We're slowly merging from Jenkins to use Bitbucket Pipelines instead.

Though, we're experiencing that build setup is very slow and it seems like it's git clone that's slow.

I've set clone depth to 1 to try and mitigate it a bit, but it still takes 1 minute per step just for cloning...

Our repo size is 2.4GB, but that can't be the whole reason for it, can it?

The pipeline is taking its time with 12 steps all taking 1 minute just for build setup and first then start the actual pipeline scripts.


Answers:
author: Theodora Boudale
body: Hi Ren? and welcome to the community!

Does this repo have any large binary files on the branch/commit where the build runs? Such files may cause slowness in Git operations.

Does this Pipelines build run on Atlassian's infrastructure or are you using a [self-hosted runner](https://support.atlassian.com/bitbucket-cloud/docs/runners/)? In case you use a self-hosted runner, clone times may be affected by network issues between the server where the runner runs and Bitbucket Cloud.

If the build runs on Atlassian's infrastructure, I suggest cloning on your computer the branch where the affected Pipelines build runs. If you observe that the time taken is not similar to the time the cloning takes in Pipelines, then please create a ticket with the support team and share the URL of one of the affected builds for further investigation.

You can create a ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. When you are asked to provide the workspace URL, please make sure you enter the URL of the workspace that is on a paid billing plan to proceed with ticket creation.

Kind regards,  
Theodora

comments: author: Ren? Dyhr
body: Hi Theodora,

Thank you for the answer and tips!

I might be a problem that we have a fair few mp4 files in our repo, this could potentially add up and therefor be slow, it makes sense.

We are using Atlassian's infrastructure, so it would be even slower on our own hardware with the network etc.


author: Theodora Boudale
body: Hi Ren?,

Indeed, I believe that the mp4 files are most likely causing the slowness during clone.

If you don't need these files during the build, you could migrate the repo to Git LFS (track the mp4 files with Git LFS):

* <https://support.atlassian.com/bitbucket-cloud/docs/use-bfg-to-migrate-a-repo-to-git-lfs/>

Git LFS files do not get cloned during build setup by default and there is a flag to download them in a certain step if needed:

* <https://support.atlassian.com/bitbucket-cloud/docs/git-clone-behavior/#LFS>

Please keep in mind that migrating a repo to Git LFS is a process that includes history rewrite, so the commit hashes of the repo will change. If you would like to convert the repo to use Git LFS, I recommend discussing this with your team first to avoid any confusion.

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-pipelines

cloud