youngmon/atlassian-qna huggingface dataset:
Why receive Bad request "result-service.pipeline.yml-not-found" for triggering pull request
Asked by Ganna Koval:

I need to trigger a pull request pipeline. First, I get a list of open pull requests by

```
/2.0/repositories/{workspace}/{repo_slug}/pullrequests?state=OPEN
```

And then in loop I put necessary information from response to payload for triggering a pull request pipeline

```
issues = json.loads(getResponse.text)['values']
for issue in issues:
id=issue['id']
source = issue['source']
destination = issue['destination']
payload=json.dumps({
"target": {
"type": "pipeline_pullrequest_target",
"source": "pull-request-branch",
"destination": destination['branch']['name'],
"destination_commit": {
"hash" : destination['commit']['hash']
},
"commit": {
"hash" : source['commit']['hash']
},
"pullrequest" : {
"id" : str(id)
},
"selector": {
"type": "pull-requests",
"pattern": "VR-*"
}
}
})
```

So, my payload is like:

```
{
"target": {
"commit": {
"hash": "311349281708"
},
"destination": "develop",
"destination_commit": {
"hash": "c6da67fa6551"
},
"pullrequest": {
"id": "66"
},
"selector": {
"pattern": "VR-*",
"type": "pull-requests"
},
"source": "pull-request-branch",
"type": "pipeline_pullrequest_target"
}
}?
```

I send it by

    /2.0/repositories/{workspace}/{repo_slug}/pipelines/

And in response I get:

```
 "error": {
"data": {
"arguments": {},
"key": "result-service.pipeline.yml-not-found"
},
"detail": "bitbucket-pipelines.yml not found.",
"message": "Bad request"
}
```

My bitbucket-pipelines.yml is :

```
pull-requests:
  VR-*:
    - step: *quality-gate-setup
    - step: *quality-gate-run
  VRS-*:
    - step: *quality-gate-setup
    - step: *quality-gate-run
  release-*:
    - step: *quality-gate-setup
    - step: *quality-gate-run
```


Answers:
author: Gonchik Tsymzhitov
body: Hi!

Which headers do you send?

comments: author: Ganna Koval
body: ```
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
    
```


Tags: api

bitbucket-cloud

bitbucket-pipelines

pull-request
Bitbucket pipelines with Gradle - Java heap space error
Asked by Guy Bashan:

I keep getting this error when trying to build a project with Bitbucket pipelines and Gradle:

**`* What went wrong:`**

**`Execution failed for task ':compileScala'.``> `**

**`Java heap space`**

The machine is x2 and I do have gradle.properties with increased memory settings:

```
org.gradle.jvmargs=-Xms512m -Xmx5g -XX:MaxPermSize=1024m -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
```

Anything else I am missing?


Answers:
author: Harry Scrivens
body: *Hi [@Guy Bashan](/t5/user/viewprofilepage/user-id/134896)*

*I think i got this nearly everyday you are missing:*

```
org.gradle.jvmargs=-Xms512m -Xmx5g -XX:MaxPermSize=1024m -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 Fu=IX ISSUE 
```

I suggest you email alatisian support by [https://support.atlassian.com/contact/#/](https://support.atlassian.com/contact/#/?)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

error

heap

java

memory
Unable to create an environment variable...
Asked by curtisa:

Hi all,

I've tried for probably hours to get the below working but I just can't seem to be able to create an environment variable. The API I'm calling is ...

```
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer \<token\>" -d '{"key": "mytestkey", "value": "value1", "secured": false }' https://api.bitbucket.org/2.0/repositories/\<username\>/\<repo-slug\>/deployments_config/environments/{environment UUID in curly brackets}/variables
```

The error I get is :

```
{"error": {"message": "Not found", "detail": "The value provided is not a valid uuid."}}
```

The environment UUID I use in the URL is what is returned from a GET on

```
https://api.bitbucket.org/2.0/repositories/\<username\>/\<repo-slug\>/environments/
```

Can anyone see what I'm doing wrong pls (I think I'm following the API docs at : <https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/deployments_config/environments/%7Benvironment_uuid%7D/variables> ). I'm not sure the API docs are strictly correct on that URL above because I don't know how you can include a UUID in the payload when you're creating a variable.

Many thanks for any help / tips...


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

You will need to encode the characters for the curly brackets in order for this to work.

**{** should be replaced with **%7B** and **}** with **%7D**

An example call:

```
curl -X POST -H "Content-Type: application/json" -u username:app-password 
-d '{"key": "mytestkey", "value": "value1", "secured": false }' https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/deployments_config/environments/%7B26e47eac-2770-4b69-8f23-92634d03a443%7D/variables
```

where 26e47eac-2770-4b69-8f23-92634d03a443 is the UUID of my Pipelines environment.

Could you please give this a try?

Please feel free to let us know if it works or if you need further assistance.

Kind regards,  
Theodora

comments: author: curtisa
body: Hi Theodora,

Yes that fixed it many thanks.

Kind regards

Alex


author: Theodora Boudale
body: Hi Alex,

That's good to hear, thank you for the update and you are very welcome!

Kind regards,  
Theodora


author: Gonchik Tsymzhitov
body: Hi!

How did you get the uuid ?

comments: author: curtisa
body: Hi,

By calling

```
https://api.bitbucket.org/2.0/repositories/\<username\>/\<repo-slug\>/environments/
```

and then picking the uuid value of the environment I want to set the variable for, i.e...

```
"uuid": "{abcdefg-12345-abcd-1234-abc1234567890}"
```


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
How to configure caching for custom base image
Asked by oguzhan:

Hi,

I've a Bitbucket Pipeline that is using an custom docker image as a base. Pulling it from the ECR. Also, I'm using this image to build dockerized Golang apps in the first step with make commands. I want to cache Golang modules that is being downloaded in the make build process. But when I read the examples, People are using golang base images to make caching work. How can I activate caching while using base image other than Go image itself? Related parts of my pipeline is on below. I defined it like this but it doesn't work.

Thank you.

```
image: 
name: <ECR Image>
  aws:  
    access-key: $AWS_ACCESS_KEY_ID 
    secret-key: $AWS_SECRET_ACCESS_KEY

definitions:
 caches:
   go: $GOPATH/pkg

pipelines:   
  - step: 
      name: "Image Build & Push" 
      services: 
        -docker 
      caches: 
        -go 
        script: 
         - export ENVIRONMENT=beta 
         - echo "Environment is ${ENVIRONMENT}" 
         - export DOCKER_IMAGE_BUILDER="${BITBUCKET_REPO_SLUG}:builder" 
         - make clean 
         - make build BUILD_VER=${BITBUCKET_TAG}.${BITBUCKET_BUILD_NUMBER} \  APP_NAME=${BITBUCKET_REPO_SLUG} \ 
    DOCKER_IMAGE_BUILDER=${DOCKER_IMAGE_BUILDER} 
         - make test
```


Answers:
author: Gonchik Tsymzhitov
body: Hi!

Will it help the next idea of caching?

```
...
- step
  caches: 
    - node-custom
  script:
    - if [ ! -d "node_modules" ]; then npm install; fi
...

definitions:
  caches:
    node-custom: public/node_modules
```

<https://community.atlassian.com/t5/Bitbucket-questions/Pipelines-cache-custom-node-modules-folder/qaq-p/771598>

Because you just want to cache the dependencies. \\

If I understood incorrectly, feel free to provide a more info please

Cheers,

Gonchik Tsymzhitov

comments: author: oguzhan
body: Hi Gonchik, thank you for your response, yes I want to cache dependencies. But as you can see, I'm using docker inside another Docker container to build another image. So go or node path may not be able to help in this case, or I couldn't make it work. In theory, is it possible to apply path based caching in my case?

Best Regards.


Tags: bitbucket-pipelines

cloud
How to configure email notifications using Microsoft office-365?
Asked by a2l:

I'm using \`atlassian/email-notify:0.4.2\` and trying to set build notifications using office365 but I am getting following error.
> Failed to send email to $BUILD_NOTIFY_USERNAME. Check your configuration settings: (535, b'5.7.3 Authentication unsuccessful \[[BY3PR05CA0008.namprd05.prod.outlook.com](http://by3pr05ca0008.namprd05.prod.outlook.com/)\]'

Credentials are correct however I'm not sure what 'HOST' value should be used. I have tried it with following host values with no difference in the result

* outlook.office.com
* smtp.office365.com
* outlook.office365.com

As per IT team we don't allow external SMTP connections to O365 because Microsoft recommends against this for security reasons. We suspect this failure is because of it.

1. By default Bitbucket sends notification email to only commit author when pipeline fails. Is it possible to configure this field to a list of email addresses either at repository or workspace level?

2. Can someone recommend what is the best practice if we want to use O365 to send build notifications considering the recommendation from Microsoft?

3. Any guidance on what HOST value should be used for office365?

Thanks in advance.


Answers:
author: yosser_mahfoudh
body: Hello [a2l,](https://community.atlassian.com/t5/user/viewprofilepage/user-id/4207372)

Did you manage to use Microsoft 365 with the pipe notification ?


author: Theodora Boudale
body: Hi [@a2l](/t5/user/viewprofilepage/user-id/4207372) and welcome to the Community!  

> 1. By default Bitbucket sends notification email to only commit author when pipeline fails. Is it possible to configure this field to a list of email addresses either at repository or workspace level?

Such notifications can be enabled by each user themselves, the following way:

1. Open the repository's **Source** page in Bitbucket website
2. Select the 3 dots at the top right corner \> **Manage notifications**
3. Select **Watch this repository** and then **Subscribe to notifications about all** \> select **Pipelines**

When a user does this, they'll get an email notification when a Pipelines build fails in this repo.
> 2. Can someone recommend what is the best practice if we want to use O365 to send build notifications considering the recommendation from Microsoft?

For this I am not sure, as it's something I've never set up myself, so I'll leave it for someone else to reply who has experience with this.
> 3. Any guidance on what HOST value should be used for office365?

As per Microsoft documentation [here](https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040?ui=en-us&rs=en-us&ad=us) the value for HOST should be smtp.office365.com

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
How to install bitbucket server on ubuntu server 20.04
Asked by Gonzalo Robles:

Hi,

I'm very new into this and I wanted to know if you have a link or manual on How to install this software on ubuntu server 20.04 via console commands.

Thank you in advance!!


Answers:
author: Daniel Ebers
body: Hi [@Gonzalo Robles](/t5/user/viewprofilepage/user-id/4207720)

yes, sure there is an installation guide:  
<https://confluence.atlassian.com/bitbucketserver/bitbucket-server-installation-guide-867338382.html>

In case of specific questions please let Community know again - a lot of skilled people are here ready for help.

Cheers,  
Daniel


Tags: bitbucket-server

server
Does Bitbucket support ReadMe.md (markdown) links within the same document file?
Asked by flxsa:

Does the ReadMe.md file in a Bitbucket repository recognize a link within the the document?

I've tried using the following but it does not work:

## TOC

\* \[Step 1\](#step1)

...

\<a name="step1"\>\</a\>

## Step 1: ...


Answers:
author: flxsa
body: I found the answer in [markdowndemo](https://bitbucket.org/tutorials/markdowndemo/src/master/)


Tags: bitbucket-cloud

cloud
Pipeline can't resolve typescript namespace import
Asked by Antonio Mata:

I'm using NestJs with Typescript for building and API, and Jest for the testing.  
I'm using Recurly, a payment service similar to Stripe  

For some reason in the Bitbucket pipeline, the process can't resolve that import  
I want to point that 'errors' is a namespace in the Recurly package

<br />

All works properly when I run my tests locally!

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


Answers:
author: Halyna Berezovska
body: [@Antonio Mata](/t5/user/viewprofilepage/user-id/4207500) it should be consistent when environments are consistent. Check if you have the same node version and use the proper node image in pipeline.

Waiting for your feedback, if you still meet the problem, you can report it here


Tags: bitbucket-pipelines

cloud
How to check branch name length in BitBucket pipeline?
Asked by arielr:

Hi all,

I want to limit my branch name length.

To do that I thought to add a step that will check the branch name length.

The step should failed if the branch name length will cross some const limit.

Does anyone know how can I do it?

Thanks :)


Answers:
author: Halyna Berezovska
body: [@arielr](/t5/user/viewprofilepage/user-id/4207644) pipelines support bash syntax. So you can check out in bash doc, how to find length and use it in your pipeline script section

Regards, Galyna


Tags: bitbucket-pipelines

bitbucket-cloud
Angular pipeline FTP does not send correct build
Asked by sourcer:

```
Hi, I want to make a pipeline that first compiles the angular project and then sends that build to the web via FTP.I have modified the angular.json and the firebase.json with the folder where it is compiled. The problem is that when you do the steps, the compilation that you upload to the ftp is not the one that you compiled. Where is the compilation? What could be happening ?, I give you screenshots of everything I mentioned.


```

![prueba1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123692i30A8E8CA918224F0/image-size/large?v=v2&px=999 "prueba1.PNG")![prueba2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123691i262142F659E85551/image-size/large?v=v2&px=999 "prueba2.PNG")![prueba3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123693i6E3FB873FDCEF3BA/image-size/large?v=v2&px=999 "prueba3.PNG")


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

Any files that you generate during a step will not be available in subsequent steps, unless you define them as artifacts.

If in your step named "Build Prod" there are files generated in the folder Front/app/public, that you want then to deploy in the next step named "Upload ftp", you should define the contents of this directory as artifacts.

The relevant section in the yml file would look like this:

```
- step:
? ? name: Build prod
? ? script:
? ? ? - cd Front/app
? ? ? - npm install -g @angular/cli
? ? ? - npm install
? ? ? - ng build
? ? ? - cd public
? ? ? - ls -l
? ? artifacts:
? ? ? - Front/app/public/**
```

You can read more on artifacts in the following documentation:

* <https://support.atlassian.com/bitbucket-cloud/docs/use-artifacts-in-steps/>

Please feel free to let us know if this works for you and if you need further assistance.

Kind regards,  
Theodora

comments: author: David salas castro
body: Thank you very much Teodora, I'm going to try it.


Tags: angular

bitbucket-cloud

bitbucket-pipelines

cloud

ftp
A username has always been refused and I don't know what to do
Asked by Hans Qin:

I am trying to register for Bitbucket account,but I can never do it, because I put in my name Hans Qin, and has always been refused as a username. I don't understad what problem it is.


Answers:
author: Theodora Boudale
body: Hi [@Hans Qin](/t5/user/viewprofilepage/user-id/4206342) ,

Could you please let us know what kind of error message you see when you enter a username?

Please note that a username cannot contain spaces, so if you enter your username as 'Hans Qin' it won't get accepted. It may include dashes and underscores though, so you could enter e.g. 'Hans-Qin', 'Hans_Qin' or 'HansQin'.

If you still have issues, it would be useful to see a screenshot with any errors/messages, so we can better help you. Please feel free to let us know if you also have any questions.

Kind regards,  
Theodora


author: Hans Qin
body: Theodora's answer was accepted. Thanks'.

comments: author: Nic Brough -Adaptavist-
body: It's not showing as accepted. Did you mean to click "accept answer"?


author: Nic Brough -Adaptavist-
body: What do you mean by "refused as a user name"? What are you seeing? What is the error message?


Tags: bitbucket-cloud
Why can't login bitbucket.org ?
Asked by thura:

![Screenshot from 2020-12-29 11-05-06.png](https://community.atlassian.com/t5/image/serverpage/image-id/123639i12849714B4FF05F8/image-size/large?v=v2&px=999 "Screenshot from 2020-12-29 11-05-06.png")


Answers:
author: Theodora Boudale
body: Hi [@thura](/t5/user/viewprofilepage/user-id/4206112) and welcome to the community.

I would like to ask for some additional info, so we can better help you. Could you please let us know:

**1.** What browser are you using when you try to log in to Bitbucket, and which version of this browser?

**2.** If you open an Incognito/Private window of the same browser, disable all browser extensions, and then log in to <https://bitbucket.org/>, do you get the same error or can you log in successfully?

**3.** Are you able to log in to <https://bitbucket.org/> from a different browser on the same machine?

**4.** Are you able to log in to <https://bitbucket.org/> from a different device, e.g. your mobile phone?

I would like us to narrow down whether the issue may be related with the browser, extensions, device or your account.

Kind regards,  
Theodora


author: Nic Brough -Adaptavist-
body: Your url is not of a bitbucket service and the service that is doesn't now what to do with the setcst parameter you are feeding it.

Try actually hitting a bitbucket site.


Tags: bitbucket-cloud

cloud
Struggling with date format in table transformer
Asked by Andy Knott:

I understand that table transformer can be used to format colours of rows when an expression is evaluated. and I'm successfully understanding how to do that with string data - but I'm struggling to understand te approach when the field being formatted contains a date element.

So the problem is to evaluate a field, my intent is to check the data field and then highlight those rows where the date has been missed

When I run this code, what happens is the date field is populated with a 13 digit integer rathe than the original date value that was in the cell - I have confirmed that the table transformer and the table have the same date structure, ie d m yy.

Any pointers will be appreciated as I'm finding this rather frustrating.

FORMATWIKI("{cell:bgColor=" +  
CASE WHEN T1.'Owner' = "AA" THEN "#FFA07A"  
WHEN T1.'Owner' = "Test" THEN "#ADD8E6"  
ELSE "#D3D3D3"  
END  
+ "}" + T1.'Task' + "{cell}")  
AS 'Task',  
FORMATWIKI("{cell:bgColor=" +  
CASE WHEN T1.'Owner' = "AA" THEN "#FFA07A"  
WHEN T1.'Owner' = "Test" THEN "#ADD8E6"  
ELSE "#D3D3D3"  
END  
+ "}" + T1.'Dates' + "{cell}")  
AS 'Dates',  
FORMATWIKI("{cell:bgColor=" +  
CASE WHEN T1.'Owner' = "AA" THEN "#FFA07A"  
WHEN T1.'Owner' = "Test" THEN "#ADD8E6"  
ELSE "#D3D3D3"  
END  
+ "}" + T1.'Owner' + "{cell}")  
AS 'Owner'  
FROM T1


Answers:
author: Stiltsoft support
body: Hi [@Andy Knott](/t5/user/viewprofilepage/user-id/1514029) ,

Please add the FORMATDATE function before calling the 'Dates' column:

...  
FORMATWIKI("{cell:bgColor=" +  
CASE WHEN T1.'Owner' = "AA" THEN "#FFA07A"  
WHEN T1.'Owner' = "Test" THEN "#ADD8E6"  
ELSE "#D3D3D3"  
END  
+ "}" + **FORMATDATE** (T1.'Dates') + "{cell}")  
AS 'Dates'  
...

This query should be working fine.

comments: author: Andy Knott
body: Perfect thanks very much


author: Stiltsoft support
body: Hi [@Andy Knott](/t5/user/viewprofilepage/user-id/1514029) ,

Another option is to use commas instead of pluses inside the FORMATWIKI functions: it helps to preserve not only dates automatically but the original cells' contents in general (clickable links, text style, etc.).

Please check an example from our [documentation](https://docs.stiltsoft.com/tfac/cloud/advanced-table-cells-formatting-58426218.html#Advancedtablecellsformatting--Preservinginitialcellformatting?utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) (navigate to the "Preserving initial cell formatting" section).


Tags: cloud

confluence-cloud

filter

table

table-filter

table-filter-and-charts

table-transformer
Confluence: Content indexing fails with the following error
Asked by Mark Hitt:

Hello,

When running running the Content Indexing tool in Confluence Server version 7.19.4, I get the following error.

**ERROR \[Indexer: 3\] \[engine.jdbc.spi.SqlExceptionHelper\] logExceptions Incorrect syntax near ')'**

I've checked the confluence.cfg.xml file and do not see the syntax mentioned in the error.

Not sure how to resolve the issue so that I can run the Content Indexing tool.

Thanks


Answers:
author: Kurt Klinner
body: [@Mark Hitt](/t5/user/viewprofilepage/user-id/1143883)

Which database are you using? When did zou run the reindex the last time successfully?

Are there any additional information in the log file around that exception?

Cheers

Kurt

comments: author: Mark Hitt
body: My solution was to upgrade to or above 7.19.5. Thanks for your help Kurt


Tags: confluence-server

server