youngmon/atlassian-qna huggingface dataset:
JEC - How to use issue data as a parameter?
Asked by Iker G?mez Eiras:

So I've been trying to tinker with running scripts through JEC, but I can't find *anything at all*about how to use JIRA data as a parameter for my scripts.

Yes, I can send the data to JEC as a key-value pair.

But how in the name of $deity do I use those key-value pairs in JEC to forward them as parameters to my script? I know it's something in "args", but I've no idea what the correct "grammar" is, and as usual, the example provided by Atlassian is lackluster.

The video Atlassian provided explaining this feature (in [What's New in Jira Service Management - April 2024 (atlassian.com)](https://community.atlassian.com/t5/Jira-Service-Management-articles/What-s-New-in-Jira-Service-Management-April-24/ba-p/2667284)) also comes short, showing how I can set up the key-value pair, but not how to configure my JEC JSONs to use those values.

Has anyone managed to get this working, and could shed some light on this?  
Thanks in advance for your time.


Answers:
author: Gabriell Valentine
body: Ok [@Iker G?mez Eiras](/t5/user/viewprofilepage/user-id/4999010) After reaching out to helpdesk and tinkering around I've made progress. I created a powershell script that outputs $args to a text file and found that I got four arguments.   

-payload  
{"actionType":"custom","activationId":"XXXXXXXX-XXXX-XXXXX-XXXX-XXXXXXXXXXXX","action":"SimpleNotifyTeams","requestId":"XXXXXXXXX-XXXXX-XXXXX-XXXX-XXXXXXXXXXXXX","sendCallbackToStreamHub":false,"args":"Args String","Message":"Message String","List":\["List Value 1","List Value 2"\]}  
-apiKey  
XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXX  
-jsmUrl  
<https://api.atlassian.com>  
-logLevel  
DEBUG  

In my case I would have to take that -payload param, convert from JSON and THEN I could get to the three key pairs I actually passed to the script (args, Message, and List). Powershell is the only language I know well, So I'm sot sure how this would work in Python or what have you, but there you go. If there was ANYTHING in the documentation to suggest this was how this would work I did not see it either.

comments: author: Iker G?mez Eiras
body: [@Gabriell Valentine](/t5/user/viewprofilepage/user-id/5171136) Honestly, I kinda gave up on this -- moved on to other tasks, decided to wait until either the community or Atlassian properly documented it. Or my company decided to use other tools.

Just tried and yep, had to add a "$payload" param to my script (I also use powershell) which provides the whole thing. Thanks!


author: Gabriell Valentine
body: I'm really happy to know I'm not the only one struggling with this. It would be really helpful is there were somewhere I could send the incoming JSON so I could figure out what is actually being sent when I pass along those key pairs. The documentation is pretty confusing and there doesn't seem to be any other online resources for figuring this out. I'll keep testing and If I find anything I'll let you know [@Iker G?mez Eiras](/t5/user/viewprofilepage/user-id/4999010)


Tags: automation

cloud

jira-service-management

jira-service-management-cloud
I want to manage my users well and create a good organization.
Asked by ???_??_:

I am an organization manager.  
I want to manage my users well and create a good organization.  
From whom and how should I learn?


Answers:
author: Ben Finn
body: Anyanghaseyo [@???_??_](/t5/user/viewprofilepage/user-id/4704901)

Could you describe your goals a bit more? Your challenges.

comments: author: ???_??_
body: [@Ben Finn](/t5/user/viewprofilepage/user-id/5368264) Hello, Thank you for your attention  

Product information in use  
\* JSM standard plan  
\* Restrictions on Automation usage exist

CUSTOMERS  
1. Customers are contract employees who have signed a contract with the company.  
2. Segmented into different customer teams within the company.  
3. Customers can view and comment on tickets created by other customers or other customer groups.  
4. There are also confidential tickets that customers cannot access.

AGENT  
1. AGENT is an employee within the company.  
2. AGENT exists in each organization within the company.  
3. Because they are divided by organization, issue transfers (requests for work cooperation/technical support) occur.  
4. AGENT processes and responds to issues requested by customers.

worry  
\> Should projects be managed by organization?  
\> What are the problems when using only one project?  
(Clear division of issue personnel is required, issue main person in charge, assignment of sub person in charge, statistics, etc.)  
\> How to manage issues if the project is divided by organization? (issue division / comment management / issue counting for statistics.. etc..)  
\> What is the structure of the portal? (Request Type...)  
\> When a ticket is created, check the issue in each organization through the notification and filter screen (Automation representative notification)


Tags: cloud

jira-service-management

jira-service-management-cloud
How would I hide "Log Work" field with behaviour (scriptrunner)?
Asked by Angel Ferreira:

Hi,

How would I hide "Log Work" field with behaviour (scriptrunner) in the create screen,

I have this code but doesn?t work

______________________________________________________________________________________  
import com.atlassian.jira.issue.Issue  
import com.atlassian.jira.component.ComponentAccessor

def Result = getFieldById(getFieldChanged()).getValue()

if( Result == "No"){

getFieldByName('Log Work').setHidden(true)  
}

if( Result == 'Si'){

getFieldByName('Log Work').setHidden(false)  
}  
______________________________________________________________________________________  
Thanks


Answers:
author: Stefan Stadler
body: Hi Angel,

the script you are showing should actually work already. I believe this is related to where you define this script. As you want to react on the change for your "Result" field, you have to assign this server-side script to this field configuration.

I could also imagine, that the naming of the field is not that correct. Maybe it is similar to the Original estimate and Remaining estimate, which are part of the same field "Time tracking"?

Can you post a screenshot how you added this so that we can verify?

Regards,

Stefan


Tags: behaviours

cloud

jira-data-center

jira-service-management

jira-service-management-cloud

scriptrunner

worklog
Bitbucket builtin ssh caching not working
Asked by ??????????? ?????:

I'm trying to enable ssh caching on our Bitbucket instance by guide

<https://confluence.atlassian.com/bitbucketserver076/scaling-bitbucket-server-for-continuous-integration-performance-1026535678.html>

And instance returns that both protocols caching is enabled

```
["HTTP","SSH"]
```

But i noticed that after 2-4-6 sequential clone requests

```
git clone ssh://git@<instance_name>/dops/devops-infra-scripts-test.git 6
Cloning into '6'...
remote: Enumerating objects: 11881, done.
remote: Counting objects: 100% (11881/11881), done.
remote: Compressing objects: 100% (4341/4341), done.
remote: Total 11881 (delta 7952), reused 11031 (delta 7321)
Receiving objects: 100% (11881/11881), 7.99 MiB | 361.00 KiB/s, done.
Resolving deltas: 100% (7952/7952), done.
```

size of cache still "0"

```
{"hits":0,"misses":0,"size":0,"regions":[{"region":"33112","hits":0,"misses":0,"size":0,"last-accessed":"Tue Jul 11 20:07:00 MSK 2023","entries":[]}]}
```

Everything is fine?


Answers:
author: ??????????? ?????
body: after 7-8 times of cloning operations the cache appeared :)

```
{"hits":10,"misses":2,"size":8386796,"regions":[{"region":"33112","hits":10,"misses":2,"size":8386796,"last-accessed":"Tue Jul 11 20:51:29 MSK 2023","entries":[{"key":"clone|90b59fce78c4defb69ba6afac2c9339142c8f0240ab5cc480265febca9904c3f","created":"Tue Jul 11 20:51:29 MSK 2023","last-accessed":"Tue Jul 11 20:51:29 MSK 2023","hits":0,"size":8386796}]}]}
```


Tags: bitbucket-server

server
Problem logging into bitbucket
Asked by julian gonzalez:

Hi, I'm trying to log in to bitbucket.org, but I'm getting an error that I'm attaching as an image. Additionally, the error throws a code to go to support, which is:

65a307f2a4c94aa48c4c965274bc1b6e

I need to activate the account in bitbucket and add it to jira to work together.

Greetings,

![PROBLEM BITBUCKET.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/268067iB03AB161C8A09EF6/image-size/large?v=v2&px=999 "PROBLEM BITBUCKET.jpg")


Answers:
author: Mark C
body: Hi [@julian gonzalez](/t5/user/viewprofilepage/user-id/5265465),

Welcome to the community.

It seems your Bitbucket Cloud account was inactive due to not logging in to [Bitbucket.org](https://bitbucket.org/) for a long period of time.  
For that, I went ahead and reactivated your Bitbucket Cloud account.

You can now log in to [Bitbucket.org](https://bitbucket.org/) again.

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
Something went wrong
Asked by Juan Camilo Alvarez Romero:

Something went wrong

While we check things on our end, try refreshing the page. If reloading the page doesn't help, check our [status page](https://status.bitbucket.org/) for known incidents or planned maintenance.

If you are still experiencing issues, our support team can be reached via StatusPage. Use the code below when reporting your issue, this will help the team look up details of what went wrong:

`7014b88710e044a194d758825ac84952`


Answers:
author: Theodora Boudale
body: Hi [@Juan Camilo Alvarez Romero](/t5/user/viewprofilepage/user-id/5265421),

There is an existing Bitbucket Cloud account with the same email as your community account.

The status of this account indicates that an account deletion was initiated (which takes 14 days to complete, unless the user logs back in during this 14-day period).

Did you initiate the deletion of this account? And would you like to cancel now this account's deletion?

I see that you created a ticket for this issue as well and you mentioned an account whose username ends in "123". Please note that the username of the account I am talking about ends in "121" and not "123".

Kind regards,  
Theodora

comments: author: Juan Camilo Alvarez Romero
body: [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) Yes I deleted the account but as a possible solution it did not work and I created the account again with the same email but the error continued in this case what could I do


author: Theodora Boudale
body: Hi [@Juan Camilo Alvarez Romero](/t5/user/viewprofilepage/user-id/5265421),

The deletion of the Bitbucket Cloud account was not completed, and the account is now in a broken state. This is the reason for the error you see.

Is it ok with you if I delete this account so that you can recreate it afterwards?

The workspace of this account has no repositories, so no repository data will be lost. The account has access to another workspace's repository, you will need to request a new invitation if I delete the account.

Please let me know if you agree that I proceed with the deletion.

Kind regards,  
Theodora


author: Juan Camilo Alvarez Romero
body: [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) yes i agree


author: Theodora Boudale
body: Hi [@Juan Camilo Alvarez Romero](/t5/user/viewprofilepage/user-id/5265421),

Thank you for the confirmation.

I have deleted the account. You can now try creating a new Bitbucket Cloud account with this email.

Please feel free to let me know how it goes and if you have any questions.

Kind regards,  
Theodora


author: Juan Camilo Alvarez Romero
body: [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) thank you very much it worked perfect


author: Theodora Boudale
body: That's good to hear and you are very welcome!

Please feel free to reach out if you ever need anything else!


author: Juan Camilo Alvarez Romero
body: ![Captura.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/268068iC242B8542DE00F3F/image-size/large?v=v2&px=999 "Captura.PNG")


Tags: bitbucket-cloud

cloud
Bitbucket pipeline problem overriding variable when using anchors and pipes
Asked by ????? ?????:

Hello,  
I have generic step to send slack message. It is using BB in-house pipe.  

However, I want to reuse this step in later steps with overriding env varibales.  
How I can do that ?  

( we deliberately want to use variables to be present in bitbucket pipeline file and not relay on UI option bitbucket provide, since it is hard to have "change control" over there )  

```
 - step: &notify_step
     script: &slack_pipe
       - pipe: atlassian/slack-notify:2.0.0
         variables:
             WEBHOOK_URL: $WEBHOOK_URL
             PRETEXT: "*Hello*"
             MESSAGE: "MYVAR is $MYVAR"


 - step: &notify_staging
     <<: *notify_step
     name: Notify Staging 
     script:
        - export MYVAR=xxx
        - *slack_pipe

```

<br />

Code above doesn't work:  

```
This section should be a string or a map (it is currently defined as a list).
```


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

If you use overrides with **\<\<: \*notify_step**, you cannot add a script with additional commands in the step.

What you can do instead is add a definition for the pipe and then use this definition in different steps. An example is the following:

```
image: atlassian/default-image:4

definitions:
  pipes:
    - pipe: &slack_pipe
        pipe: atlassian/slack-notify:2.0.0
          variables:
            WEBHOOK_URL: $WEBHOOK_URL
            PRETEXT: "*Hello*"
            MESSAGE: "MYVAR is $MYVAR"

pipelines:
  default:
    - step:
        name: Notify staging
        script:
          - export MYVAR="XXX"
          - *slack_pipe
    - step:
        name: Notify production
        script:
          - export MYVAR="YYY"
          - *slack_pipe
```

Does this work for you?

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
self-hosted running failing on launch
Asked by chus alvarez:

After launch again a runner, the docker seems to crass on entry point:

+ ./entrypoint.sh

Error: Unable to access jarfile config

The image failing is the currently set to "latest" one:

Image:

docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-runner:latest

Image ID: docker-pullable://docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-runner@sha256:a06a16bfe447223a7bd965871e3394c32dd70aab34164bbbe8dafc786411c3c1


Answers:
author: Ben
body: Hi chus,

Welcome to the Bitbucket Cloud community!

To clarify - if you attempt to re-run the build, does the same crash occur? I am unable to reproduce this behaviour with the same Runner image that you are using on my own repository.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
connect to Bitbucket to deploy into production
Asked by andrew wrigley:

I am not allowed to have bitbucket connect to my production server (security), so I need to have that server connect and pull the final code from bitbucket.

Is this possible ?


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

You don't have to make your server accessible from anywhere on the internet, but it needs to be accessible from the IPs that Bitbucket is using. Otherwise, there is no way for your server to reach Bitbucket Cloud.

You can find on the following link the IPs and ports that Bitbucket Cloud is using:

* <https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/>

The ports are mentioned in the first paragraph and the IPs in the section **Valid IP addresses for bitbucket.org, api.bitbucket.org, and altssh.bitbucket.org**.

Kind regards,  
Theodora

comments: author: andrew wrigley
body: The problem is that's several IP ranges, and our security just won't allow it.

Is there any solution to this ?


author: Theodora Boudale
body: Hi Andrew,

If you only use IPv4, then you only need to whitelist the following ranges (and not everything from that page):

```
104.192.136.0/21
185.166.140.0/22
18.205.93.0/25
18.234.32.128/25
13.52.5.0/25
```

If that is still a lot for your security team, and if you only need to clone/pull a Bitbucket Cloud repo (and not use our API), then you could:

* edit the hosts file on this server to resolve bitbucket.org to an IP from the range 104.192.136.0/21
* then whitelist on your firewall this specific IP

Please keep in mind though that if the firewall or a proxy in your network tries to resolve bitbucket.org again and ends up getting a different IP than the one set on the hosts file, the operation will fail.

This is not a recommended setup because the IPs we use could change at any time. In case this happens, there will be a failure again until you update the hosts file and your firewall with one of the new IPs.

Kind regards,  
Theodora


author: andrew wrigley
body: 104.192.136.0/21 is a range not an IP, I can't edit the host file to resolve to a range.


Tags: bitbucket-cloud

cloud
remote: Repository is over the size limit (4 GB) and will not accept further additions.
Asked by Jasmine Zhang:

Given my repo size is over 4GB, would like to remove a folder with big files in order to reduce the repo size, but can't commit the change due to oversize. See the error message below:

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks commit -q -F C:\\Users\\jzhang\\AppData\\Local\\Temp\\sk0oz4cl.0fc

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags --set-upstream origin master:master  
POST git-receive-pack (33826 bytes)  
remote: Repository is over the size limit (4 GB) and will not accept further additions.  
remote:

remote: Learn how to reduce your repository size: <https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/#Rewind-history-to-undo-large-commits>.  
Pushing to [https://bitbucket.org/\*/reports.git](https://bitbucket.org/kippfdn/reports.git)  
To [https://bitbucket.org/\*/reports.git](https://bitbucket.org/kippfdn/reports.git)  
! \[remote rejected\] master -\> master (pre-receive hook declined)  
error: failed to push some refs to '[https://bitbucket.org/\*/reports.git](https://bitbucket.org/*/reports.git)'

<br />

Completed with errors, see above.


Answers:
author: Jasmine Zhang
body: The problem is resolved by following the instruction of how to reduce the repository size! Thanks!


Tags: bitbucket-cloud
Bitbucket self-hosted runner user
Asked by Svetlozar Petkov:

I looked over the internet, but I could not find the answer to this question.

What user does the bitbucket runner use when installed in a linux server ?

For example gitlab uses the gitlab-runner user in bitbucket how can you define which user the runner uses and is it possible to do so ? The question is for both docker and linux shell.


Answers:
author: Patrik S
body: Hello [@Svetlozar Petkov](/t5/user/viewprofilepage/user-id/5259535) and thank you for reaching out to the community!

* For Linux docker runner :  

  When installing docker in your machine, the docker daemon by default uses the root user. If you want to run docker daemon in rootless mode, you will need to install docker following the instructions of [Run docker daemon as non-root user](https://docs.docker.com/engine/security/rootless/).  

  As for the user inside the runner container, it's also using the root user as default.
* For the Linux Shell runner :   

  The user that executed the runner start script. It will usually be the user of the terminal session where you executed the ./start.sh pre-defined script you received when creating the runner.

Thank you, [@Svetlozar Petkov](/t5/user/viewprofilepage/user-id/5259535) !  
Patrik S

comments: author: Svetlozar Petkov
body: Thank you for the response. This cleared things up nicely!


Tags: bitbucket-cloud

cloud

user
What steps are needed in order to receive a code transfer from another BitBucket?
Asked by Thomas Ulm:

Both are bit bucket accounts (independent) and I will be receiving the code, I have a new Bitbucket account, I am Admin user, additionally I need to set up the same person to have admin user on my account as well, I would like to know about both variations, that is, code ownership transfer and/or just clone transfer and their procedures. Thank you!


Answers:
author: Aron Gombas _Midori_
body: Here is the documentation of transferring the ownership of a repository: <https://support.atlassian.com/bitbucket-cloud/docs/transfer-repository-ownership/>

I am not sure what you meant by "clone transfer". You can, of course:

1. git clone the source repository
2. add the target repository as a new remote
3. push to this new remote


Tags: bitbucket-cloud

cloud
New rsa key has broken sourcetree for me
Asked by adam mcdonald:

I've been working all morning to try to get sourcetree updated to work with the new keys from bitbucket cloud. I am unable to pull any of my companies code from bitbucket now and am unable to develop.


Answers:
author: Theodora Boudale
body: Hi Adam,

We have created the following FAQ page for the host key rotation:

* <https://confluence.atlassian.com/bbkb/bitbucket-cloud-ssh-host-key-rotation-faq-1235851234.html>

In the section **Technical Questions**, there are questions and answers for SourceTree for Mac and SourceTree for Windows.

Please feel free to let me know if you are able to resolve the issue with the information provided in these answers or if you need further help.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

sourcetree
Cannot parse "serverless.ts": Resolution of "ts-node" failed with: "ts-node" not found
Asked by Antonio Lopes:

Hey there,

According to the atlassian/serverless-deploy:1.2.0 (<https://bitbucket.org/atlassian/serverless-deploy/src/master/>), to set different Serverless configuration file we should define CONFIG param. However, it doesn't say anything about the ts-node.

Anyway, after config it according to the doc:

```
image: atlassian/default-image:3

pipelines:

  pull-requests:

    master:

      - step:

        name: Deploy to Production

        deployment: Production

        script:

          - pipe: atlassian/serverless-deploy:1.0.0

            variables:

              AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID

              AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY

              AWS_DEFAULT_REGION: 'us-east-1'

              CONFIG: 'serverless.ts'

              EXTRA_ARGS: '--stage production --verbose'
```

I got the following error.

![Screenshot 2023-07-10 at 10.41.53.png](https://community.atlassian.com/t5/image/serverpage/image-id/267762i42725952B23725C6/image-size/large?v=v2&px=999 "Screenshot 2023-07-10 at 10.41.53.png")

So, I was wondering if you guys have any idea.


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

From the error being shown, it seems like your serverless deploy is looking for the ts-node package, but this does come installed in the pipe's container by default.

In such case, you can install the ts-node package and any other package you need by using the pipe's variable

```
PRE_EXECUTION_SCRIPT
```

This should point to a script file that will be run inside the pipe's container at the beginning of its execution.

In the example below, we are creating a script during the run-time to install **typescript** and **ts-node** packages, and executing it inside the pipe as a PRE_EXECUTION_SCRIPT :

```
script:  - echo 'npm install typescript ts-node' > .my-script.sh  - chmod 005 my-script.sh  - pipe: atlassian/serverless-deploy:1.2.0    variables:      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
      AWS_DEFAULT_REGION: 'us-east-1'
      CONFIG: 'serverless.ts'
      EXTRA_ARGS: '--stage production --verbose'      PRE_EXECUTION_SCRIPT: '.my-script.sh'
```

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

Thank you, [@Antonio Lopes](/t5/user/viewprofilepage/user-id/5235112) !

Patrik S

comments: author: Antonio Lopes
body: Hey [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)

Thanks! It worked.


Tags: bitbucket-cloud

cloud

lambda

serverless