youngmon/atlassian-qna huggingface dataset:
Custom field not recognized in Jira automation "additional fields"
Asked by Dave Vronay:

Hi there,

I have a team-managed project. On the epic, I have a custom field called "Design Reviewers". When this field is changed, I want to update the custom field called "Reviewers" on any issue in that epic that is of issue type "design".

I can get all of the logic working, but when I try to update the field, it fails, saying that the field "Reviewers" does not exist. Here is the JSON I am using:

{  
"fields": {  
"Reviewers": {{issue.epic.Discovery Reviewers.asJsonObjectArray("name")}} }  
}

The error I get is

"

additional fields contains invalid field(s) in 'update' or 'fields" section

Reviewers

"

Any idea? The Reviewers field is on the issue, and other automation is referencing it.


Answers:
author: Alex Koxaras _Relational_
body: Hi [@Dave Vronay](/t5/user/viewprofilepage/user-id/5082958) and welcome to the community,

To be honest this rule was a real pain in the \*\*\*. It took me a solid 30 mins to figure this out. The json that worked for me was the following:

```
{
"fields": {
    "Reviewer": {{issue.epic.Design Reviewer.asJsonObjectArray("accountId")}}
 }
}
```

Of course modify the above fields to your likings. The whole rule was like this (I choose the trigger to be issue updated for my tests):

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

Let me know if that works out for you!

comments: author: Dave Vronay
body: This works, but - for some unknown reason - it does NOT work if the field is called "Reviewers". It works with any other name...


author: Alex Koxaras _Relational_
body: Whaaa??!?!?

You mean the plain reviewer or the design reviewer?
Handle sprint removal
Asked by Peder Alm:

Hi

Is it possible to catch when a user tries to delete a sprint? When I search for triggers I only find:

* Sprint created
* Sprint started
* Sprint completed

The goal is to restrict that deletion of a sprint only can be done form the board where it was created. Now we have major issues that a sprint, by mistake or purposely, is visible in another board and that the board owner deletes it based on "this sprint isn't mine". :(

Another option is to set that only the Jira project owner is allowed to delete a sprint.

Unfortunately the Jira permissions for "manage sprint" includes "delete sprint". Better would be to have "delete sprint" as a separate permission, but that is a case for another forum.


Answers:
author: Hamza Chundrigar
body: Hi [@Peder Alm](/t5/user/viewprofilepage/user-id/3958578)

I hope you're doing well.

With the '**Manage Sprints** ' permission, permissions are now checked against the filter query of the origin board --- the board from which the sprint is created --- not just against the issues within the sprint (as per this [Atlassian article](https://support.atlassian.com/jira-cloud-administration/docs/use-manage-sprints-permission-for-advanced-cases/))

> *Depending on the filter query being used, your board might display sprints from other boards. For example, you have the ++**TIS board**++ and it's displaying Sprint 3, which was created in another **board** --- the ++**PMO board**++ . In this case, the ++**PMO board**++ is the **origin board** of Sprint 3.*
>
> *If you're in the **TIS board** and you're closing Sprint 3:*
>
> * *Jira Software checks if you have the '**Manage Sprints** ' permission for the projects in the **origin** ++**PMO board**++.*

Have a look at that article (linked above) and consider following the stated approach:

* Create a new project role called **Sprint Manager**.
* In the corresponding permission scheme, assign the '**Manage Sprints** ' permission to the Sprint Manager **project role**.
* Associate the permission scheme with the corresponding projects in your instance.
* Add the appropriate users to the**Sprint Manager project role**.

This may not be the most optimal solution you might be looking for, but this coupled with having an honest discussion with your "sprint managers" about being extra cautious going forward should hopefully reduce any erroneous sprint deletion.

I am not aware of any feature improvement requests opened for Jira Cloud (though I believe I saw one for Jira Server) where someone raised a suggestion of being able to restrict sprint deletion by having its own specific user permissions settings. If there isn't, then it may be worthwhile to create one.

Cheers,

Hamza


Tags: delete

sprint
Pop-up message in Jira Cloud?
Asked by Jira:

Is there a way to pop-up a message on selection of any custom field in JIRA cloud in order to notify user in real time.


Answers:
author: Alex Koxaras _Relational_
body: Hi [@Jira](/t5/user/viewprofilepage/user-id/5075564)

If you mean to have a pop up appear to a user on field-entry (e.g. on mouse click) or whenever a user will try to click on a field, then no. There isn't a way to do that.

comments: author: Jira
body: If there is a custom field of text and someone tries to edit the field, then a pop-up msg should come saying "the field should not be edited at this time".


author: Alex Koxaras _Relational_
body: No you can't do that.

What you can do is to remove this field from the Edit Screen and create a self transition with a screen including only this field, to the status(es) you want your users to edit it.


author: Nic Brough -Adaptavist-
body: What do you mean by "selection of custom field"? Someone highlight the content in it to copy and paste? Click on it? Edit it?

Notify the user of what? And why?

comments: author: Jira
body: 1. Let's say there is a custom field of some dropdowns and i want to notify or give a pop-up msg on selection of some dropdowns from that custom field.

2. if there is a custom field of text and someone tries to edit the field then a pop-up msg should come saying "the field should not be edited at this time".


Tags: pop-up
Is there a way to find out the user updated the issue is from a certain Group or not ?
Asked by Prajwal Ashok Nagrale:

want to check if we can send data through webhooks when updated by a certain group only.


Answers:
author: Jack Brickey
body: Hi [@Prajwal Ashok Nagrale](/t5/user/viewprofilepage/user-id/5070890) ,

I am currently playing around with this to see if it possible. I haven't yet gotten the syntax right. With that said, as I have other things to work on today, I want to share my thoughts in hopes that it points you towards a possible solution. Maybe you can figure it out before I get back to it.

My thoughts are to set up a automation role that basically looks like this...

Trigger - issue updated

condition - if {{initiator}} is a memberof("your group")

action - whatever you need

if I am off base on your needs please let me know.


Tags: integration

jql
Define self hosted runners for whole pipeline or stage
Asked by Aurimas N_:

Hi, I was able to find how to define self hosted runners on step level only, is there a way to define it for the whole stage or whole pipeline or for repository?

The use case is for resources that are not publicly accessible and therefore everything must be done from self hosted runners, it seems a bit redundant to specify runners for each and every step.


Answers:
author: Theodora Boudale
body: Hi Aurimas,

This is not possible with a static yaml file but it should be possible with dynamic pipelines. You can check the documentation and resources here:

* <https://support.atlassian.com/bitbucket-cloud/docs/dynamic-pipelines/>

Kind regards,  
Theodora

comments: author: Aurimas N_
body: I've implemented this via dynamic pipelines, but I must say it feels more complicated than it needs to be, having a way to statically define it on the pipeline level would be so much more simple and intuitive.


author: Theodora Boudale
body: Hi Aurimas,

Thank you for the feedback. We have a feature request for the ability to specify "runs-on" golabally:

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

You can add your vote to this feature request (by selecting the **Vote for this issue** link) to express your interest, and also give your feedback there regarding the complexity of dynamic pipelines and the preference for a static definition.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Multiple stages for same environment with deployment vars
Asked by Aurimas N_:

for infra as code deployments I want to have following pipeline structure:

stage1: validate and plan for dev

stage2: apply for dev

and

repeat the same for another env

both plan and apply stages need authentication and uses deployment vars for that, but in bitbucket pipelines you can't have two stages with deployment to same env and there is no way to use same vars in both stages?

The obvious solution is to do "plan and apply" in a single stage, but I really like the logical grouping of steps to stages by the intent (plan/apply build/deploy etc.) am I thinking wrong here?

On top of that I can't use single stage because for the apply part I need some kind of approval and I couldn't find how to implement it except via "manual trigger" workaround, which can only be defined on stage level.


Answers:
author: Theodora Boudale
body: Hi Aurimas,

Multiple steps in the same pipeline cannot reference the same deployment environment, so stages were introduced to address this limitation. With a stage, you can have multiple steps grouped in the same stage that share the same deployment environment.

If the manual trigger is a requirement, you can create a separate custom pipeline for the steps you would use in stage 2 and trigger it manually:

* <https://support.atlassian.com/bitbucket-cloud/docs/pipeline-start-conditions/#Custom--manual--pipelines>

You can trigger a custom pipeline for a branch or for a specific commit (in case you want to run it for an earlier commit of a certain branch). You can find more info on how to trigger a pipeline manually here:

* <https://support.atlassian.com/bitbucket-cloud/docs/pipeline-triggers/>

We have a request in our issue tracker for supporting manual trigger for a step in a stage that you can vote for to express your interest:

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

Kind regards,  
Theodora

comments: author: Aurimas N_
body: \> If the manual trigger is a requirement, you can create a separate custom pipeline for the steps you would use in stage 2 and trigger it manually:  

I really can't because I can't access same deployment in the second stage.  

In this case allowing manual trigger on a step in a stage would be a workaround, but the real problem is not being able to reference same deployment in multiple stages, the reason for this must be some technical limitation because having multiple stages per environment seems only logical.


author: Theodora Boudale
body: Hi Aurimas,

Thank you for the feedback. I went ahead and created a feature request for multi-stage deployments in our issue tracker:

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

I would suggest adding your vote and comment there to express your interest.

Implementation of 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 request.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Dev and Prod deploy from same branch
Asked by Aurimas N_:

Hi, I want to implement following pattern for build pipeline:

merge to main:

stage1: build and deploy to DEV env

stage2: request approvals from specific people and deploy to PROD env

I don't see a way "enable required approvals" for deployment to specific env, what would be the closest equivalent for this in bitbucket pipelines?


Answers:
author: Theodora Boudale
body: Hi Aurimas,

I'm afraid that there is no such concept as approval for a certain stage or a step of a Pipelines build. The closest thing would be a manual trigger and deployment permissions:

* <https://support.atlassian.com/bitbucket-cloud/docs/stage-options/#Trigger>
* <https://bitbucket.org/blog/deployment-permissions-now-available-in-bitbucket-pipelines>

With a manual trigger, someone will need to manually trigger the second stage. If the repo belongs to a workspace on the Premium plan and you define a deployment environment for that stage, you can make use of the option **Only allow admins to deploy to this environment** (from **Repository settings** \>**Deployments**\> select the deployment environment you use for this stage) so that only admins can trigger the stage.

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

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Trigger pipeline based on commits in another repo
Asked by Aurimas N_:

Hi,

I want to use the following pattern, but can't figure a way to do it in bitbucket pipelines.

Repo A (bussiness app A)

Repo B (k8s manifests for business app A, also pipeline definition)

Workflow:

Once there is merge to main branch in Repo A, pipeline from repo B triggers.

This is for concern separation, people developing app A are not necessary the same who are responsible for build pipelines and infra, so there is no need to clutter their repo with pipeline definition and infra elements. I've been sucessfully using this pattern in another ecosystem, how close can I get with bitbucket pipelines?


Answers:
author: Theodora Boudale
body: Hi Aurimas,

One option is to use a pipeline in repo A that will run on the main branch only, and the only thing it will do is trigger a build in repo B. You can use the following pipe in the yml file of repo A, to trigger a build in repo B:

* <https://bitbucket.org/atlassian/trigger-pipeline/src/master/>

You could also use our API instead:

* <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-post>

Another option would be to use a [webhook](https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/) in repo A that gets triggered on repo push events. A webhook can send a request to a server of yours every time the event you have selected in the triggers occurs. After the request is received by your server, you can check the webhook payload to see if the push was made to the main branch and then use our API to trigger the pipeline in repo B.

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

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Cannot clone repo in custom pipeline
Asked by Martynas ?ustavi?ius:

I have a shell script that checks out separate repository and makes changes to it.

That same script works fine when invoked via merge to development hook.

But when I try to run it using custom pipeline I get following error:  
./script.sh  
Checking out repositories  
Cloning into 'my-repository'...  
Warning: Permanently added the ECDSA host key for IP address 'x.x.x.x' to the list of known hosts.  
Permission denied (publickey).  
fatal: Could not read from remote repository.  
Please make sure you have the correct access rights  
and the repository exists.

Why could this be happening?


Answers:
author: Martynas ?ustavi?ius
body: I was not adding:  

```
runs-on:
  - a
  - b
  - c
```


Tags: bitbucket-cloud

cloud
Trying to execute python script in pipeline, fails to install items from requirements.txt
Asked by Alan Lanteigne:

I have some very basic packages needed by my script. When the pipeline runs, it fails because it can't find/install the packages. Requirements.txt includes:  
requests  
datetime  
re  
json  
shutil  
signal  
enum

What am I doing wrong?

Thanks!

2s  
1
+ pip install -r [requirements.txt](https://bitbucket.org/alanlanteigne/mediapmtools/src/94ff59a04d91794a721025200f15ffff69911dfb/requirements.txt)  
2
Collecting requests (from -r [requirements.txt](https://bitbucket.org/alanlanteigne/mediapmtools/src/94ff59a04d91794a721025200f15ffff69911dfb/requirements.txt) (line 1))  
3
Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)  
4
Collecting datetime (from -r [requirements.txt](https://bitbucket.org/alanlanteigne/mediapmtools/src/94ff59a04d91794a721025200f15ffff69911dfb/requirements.txt) (line 2))  
5
Downloading DateTime-5.5-py3-none-any.whl.metadata (33 kB)  
6
ERROR: Could not find a version that satisfies the requirement re (from versions: none)  
7
ERROR: No matching distribution found for re  
8


Answers:
author: Syahrul
body: G'day, [@Alan Lanteigne](/t5/user/viewprofilepage/user-id/2432558)

The error could mean two things:

1. Your docker image is running an older version of Pip
2. The package you're trying to install is unavailable for your Python version.

If you use the default image, you can check the Python version here and see if the version is supported for <https://pypi.org/project/DateTime/>

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud
Error - We can't log you in
Asked by John Crighton:

I can log in to my Atlassian account, but I can't access Bitbucket from any browser.


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

I see you have opened a support ticket with us and one of my colleagues helped to update your account to Active again, as it was inactive due to a long period with no login.

If you ever need help in the future, feel free to reach out to Community!

Thank you, [@John Crighton](/t5/user/viewprofilepage/user-id/5483522) !

Patrik S


Tags: bitbucket-cloud

cloud
Bitbucket pipeline failing with : level=error msg="error waiting for container: unexpected EOF"
Asked by Siddhesh Arun Salvi:

Hi I am sending my image and its dockerfile to snyk scan but I am getting about error in the pipeline.  

docker container run -e SNYK_API=<https://api.snyk.io> -e SNYK_TOKEN=\<TOKEN\> -w /project --entrypoint snyk -v /opt/atlassian/pipelines/agent/build/.:/project -e DOCKER_HOST=tcp://host.docker.internal:2375 -e SNYK_INTEGRATION_NAME=BITBUCKET_PIPELINES -e SNYK_INTEGRATION_VERSION=1.0.0 --add-host=host.docker.internal:\<IP\> snyk/snyk:docker test --json -d --docker \<Image name\> --file=Dockerfile --severity-threshold=low --json-file-output=snyk-report.json  
time="2024-04-24T10:25:56Z" level=error msg="error waiting for container: unexpected EOF"


Answers:
author: Patrik S
body: Hey [@Siddhesh Arun Salvi](/t5/user/viewprofilepage/user-id/5483204) and welcome to the Community!

Based on the logs you have shared in the description, it seems like you are using the pipe [snyk/snyk-scan](https://bitbucket.org/snyk/snyk-scan/src/develop/) to execute the scan. This pipe is developed and maintained by the Snyk team itself, so I would suggest reaching out to Snyk support for assistance with the pipe configuration or any issue you are facing with its usage :

* [support@snyk.io](https://bitbucket.org/snyk/snyk-scan/src/d09002785e394082f9a83168cfb069cb9103fbb5/support@snyk.io)

You can also find support instructions and example use cases for the pipe in its official documentation below :

* [snyk/snyk-scan pipe](https://bitbucket.org/product/features/pipelines/integrations?search=sny&p=snyk/snyk-scan)

Thank you, [@Siddhesh Arun Salvi](/t5/user/viewprofilepage/user-id/5483204) !

Patrik S


Tags: bitbucket-pipelines

cloud
How to check pull request has conflicts or not before merge the PR using rest api.
Asked by mohan yadav:

I want a bitbucket rest API endpoint to check whether a pull request has conflicts or not. Please suggest me that API endpoint.  


Answers:
author: Patrik S
body: Hello [@mohan yadav](/t5/user/viewprofilepage/user-id/5418092),

thank you for reaching out to the Community!

The following public API endpoint can be used to get the merge status if you call it without the **topic** query parameter

* <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get>

Example:

```
https://api.bitbucket.org/2.0/repositories/{WORKSPACE}/{REPOSITORY}/diffstat/feature..main
```

For the conflicted files, you will see in the output the field **"status": "merge conflict"**.

The status **"merge conflict"** was not added as a status when the **topic** query is used because this status will be eventually removed in the future.

When that happens, a new public conflict API endpoint will be made available for customers to still have access to that information.

You can follow any changes/announcements to the API's at the official documentation below:

* <https://developer.atlassian.com/cloud/bitbucket/>

Thank you, [@mohan yadav](/t5/user/viewprofilepage/user-id/5418092) !  
Patrik S


Tags: bitbucket-cloud

cloud

rest-api
Bitbucket self-hosted runner (Windows) Artifacts Problem
Asked by Michael Deynet:

We are running a Windows based self-hosted runner.

Out bitbucket-pipelines.yml contains one step:

```
pipelines:
   default:
     - step:
         name: Build firmware
         runs-on:
           - self.hosted
           - windows
           - build
         script:
           - C:\tmp\Python\python.exe C:\tmp\mpr-testrack\main_build.py
           - dir C:\tmp\TMP_DST\mpr2\out
           - mkdir %BITBUCKET_CLONE_DIR\out
           - move C:\tmp\TMP_DST\mpr2\out\* %BITBUCKET_CLONE_DIR\out\
           - dir %BITBUCKET_CLONE_DIR\out
         artifacts:
           - out\**
           - out/**


```

The idea is to copy the build files to %BITBUCKET_CLONE_DIR\\out to have the option to download these from the bitbucket webpage.

Under the script section everything works fine (the move as well as the last dir)

When teardown is performed, bitbucket does not find the artifacts:  

    Searching for files matching artifact pattern out\**
    Searching for files matching artifact pattern out/**

Under "Artifacts": "No Artifacts uploaded"

For testing purposes I implemented a following step in the pipeline and there the working directory is this:  

    C:\bucher\bitbucket_runner\atlassian-bitbucket-pipelines-runner\temp\889d0a5a-cc18-5f20-b774-c8b042721efe\1713264850790\build

I don't know where the build subfolder comes from.

And in that working directioy there is no out folder.


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

The build subfolder is automatically created during the build start, and it's where the runner will download the files from Bitbucket (clone the repository, download any artifacts, etc).

The environment variable

```
BITBUCKET_CLONE_DIR
```

will contain the full path to the build subfolder.

As for the reason why the artifact is not being uploaded, I suspect this is because you are using an invalid syntax to reference the variable, which is making the "out" folder to be created at a different path.

To reference variables in the Windows environment I'd suggest using the following syntax :

```
$env:ENV_VARIABLE_NAME
```

For example :

```
mkdir $env:BITBUCKET_CLONE_DIR\out
```

This should make sure the folder is being created at the correct location.

Could you try editing your YML file to use the above syntax in all the variables references, and try running the build again?

Should you have any questions, feel free to ask.

Thank you, [@Michael Deynet](/t5/user/viewprofilepage/user-id/5482985) !

Patrik S

comments: author: Michael Deynet
body: Thank you [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)

That is the soluation!

Thank you for your help!


author: Patrik S
body: You're very welcome!

Happy to hear updating the syntax did the trick :)


Tags: bitbucket-cloud

bitbucket-pipelines

bitbucket-runners

cloud