youngmon/atlassian-qna huggingface dataset:
what is accountID for Jira Automation?
Asked by Rizky.Tuasikal:

I need that accountID, to insert it to Validator on JMWE


Answers:
author: David Fischer
body: To find the accountId of any user, and insert it in a Jira Expression or groovy Template, you can use the "Lookup user..." button of the editor toolbar:

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

This example is for Nunjucks but it works the same in the Jira Expressions editor.

comments: author: Rizky.Tuasikal
body: thank you David :)


author: Dirk Ronsmans
body: hey [@Rizky.Tuasikal](/t5/user/viewprofilepage/user-id/4250142) ,

The "Automation for Jira" user is the one you are trying to find I assume?

I ran in to a similar issue and it doesn't seem to be a regular account. I worked around it by instead of using the account to actually use the project rol of the addons.
> atlassian-addons-project-access

which I then used on the workflow properties as id 10500.

I don't know the details of your validator but it might help


author: Rizky.Tuasikal
body: well guys, I found it:

The accountID for Jira Automation is:

user.accountId == "557058:f58131cb-b67d-43c7-b30d-6b58d40bd077"


author: Vero Rivas
body: Hi [@Rizky.Tuasikal](/t5/user/viewprofilepage/user-id/4250142)

Look at this post, maybe can help you

<https://community.atlassian.com/t5/Jira-questions/where-can-i-find-my-Account-ID/qaq-p/976527>

Cheers


Tags: addon-com.innovalog.jmwe.jira-misc-workflow-extensions

jira

jira-cloud

jira-misc-workflow-extensions
Rule tries to run action twice per trigger. Why? (When assigned, transition issue)
Asked by IndexingAlex:

I'm working in Jira Server, using Automation for Jira Lite to create what should be a very simple rule:

* When issue assigned
  * transition the issue status to In Progress

However, when I assign an issue, the audit log indicates that **it tries to transition the issue *twice.*** Why is this happening?

**Detailed Behavior:**

At first, the rule was just two components, the trigger and the action. It would return two status entries. First:
> Success. Transitioned issues to In Progress

Then the *second* status:  
> No matching transitions could be found for issues (with current status):
IDX-2 (In Progress - 3)  
Apparently, it's reporting an error because it can't find a transition from "In Progress" to "In Progress" when it attempts to run the transition a second time.  
Screen shot with example of these back-to-back log entries.  
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/179165i688F8DF22BF9CDE3/image-size/large?v=v2&px=999 "image.png")  
To verify it really is trying to run the action twice, I added a condition: only run the transition if the starting status is "To Do."  
Now it returns two statuses again. First it transitions the status successfully, like before. The second status is no longer an error--it just reports doing nothing, since the criteria to run the action wasn't met when it tries to run a second time.  
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/179173i7BF37ED4A48403A6/image-size/large?v=v2&px=999 "image.png")  
**Stuff I have already checked:**

* I get the same result regardless of whether I create this action by "Selecting the Destination" or "Selecting the Transition"
* There is only one transition that leads to the status.
* I have removed all conditions from the transition. It doesn't have any validators. It doesn't even do any Post actions except the defaults.
* Admins, Devs, and Users currently all have permission to transition issues, to assign issues, and to be assignees.
* I am a global Admin and project Admin, I own the rule, and I am currently set as the actor for the rule.

While I could in theory leave it "functioning" like this, I'm not happy leaving an unexplained behavior in my production. So what is going on here? Why is it running twice?  
(Edited for typos)


Answers:
author: Pramodh M
body: Hi [@IndexingAlex](/t5/user/viewprofilepage/user-id/3880378)

Can you change the actor to one who has the permission to transition the issue and let me know if it returns the same result

Thanks,

Pramodh

comments: author: IndexingAlex
body: I changed the actor to our other admin. (To be clear, I do have permission to transition the issue myself, but I assume you meant change it to a *different* person who also has that permission.)

To my surprise, changing the actor has resolved the problem!

**Thank you!**...But also...WHY? Can you explain what caused the problem and why this fixed it? I do not have this problem on any other rule where I left myself as the actor.
Trying to sum the story points of linked stories to the epic level, but it's not showing up?
Asked by Jon Zacharias:

I want to take sum the values in the Story Points field for all tickets that are linked to a specific epic and show that value in the Story Points field on the Epic.

I've set up an automation rule for this, and it appears as though it is working correctly based on the audit log results, but the value is not showing in the Story Points field on the Epic.

Any idea what I'm doing wrong here folks?![pic6.png](https://community.atlassian.com/t5/image/serverpage/image-id/179586iB22D47C52A10DEC3/image-size/large?v=v2&px=999 "pic6.png")

![pic3.png](https://community.atlassian.com/t5/image/serverpage/image-id/179584iA4D47B1120301288/image-size/large?v=v2&px=999 "pic3.png")![pic4.png](https://community.atlassian.com/t5/image/serverpage/image-id/179583i331232A92A013020/image-size/large?v=v2&px=999 "pic4.png")![pic5.png](https://community.atlassian.com/t5/image/serverpage/image-id/179585i150B6D721B81022B/image-size/large?v=v2&px=999 "pic5.png")


Answers:
author: Curt Holley
body: What do you have configured in the "Edit issue fields - Story points" action on the branch?  

<br />

comments: author: Jon Zacharias
body: {{lookupIssue.Story Points.sum}}


author: Charlie Gavey
body: Hi [@Jon Zacharias](/t5/user/viewprofilepage/user-id/4333232)  

Try updating this to {{lookupIssues.Story points.sum}} and see if the rule works as expected.  

<https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Automationactions-Lookupissues>  

Cheers,  
Charlie


author: Jon Zacharias
body: [@Charlie Gavey](/t5/user/viewprofilepage/user-id/4622713) this worked, thank you!


author: Fabian Lim
body: For the other users, you can also take a look at this post: <https://community.atlassian.com/t5/Automation-discussions/Jira-Automation-Complete-Video-Guides-on-how-to-Sum-Up-Story/m-p/1741948#M75>


Tags: audit-log

jql
I have added an automation to re-open a JIRA issue when a comment is added by a customer to a r
Asked by Giselle Millan:

I have added an automation to re-open a JIRA issue when a comment is added by a customer to a resolved issue. However, the they add the comment the issue is not re-opened, the log shows as an "error"

![Capture1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/178861i1DF4BA4E1075E2FA/image-size/large?v=v2&px=999 "Capture1.PNG")


Answers:
author: Pramodh M
body: Hi [@Giselle Millan](/t5/user/viewprofilepage/user-id/4718147)

Welcome to the Community!!

Is there transition present from (Resolved, Closed, Done, Canceled) to Reopen?

Make sure you have a transition

May I get the screenshot error of logs completely for an issue to troubleshoot the error

Thanks,  
Pramodh

comments: author: Giselle Millan
body: Thank you Pramodh! I went back and reviewed the transaction and updated it from Reopen issue to Re-open ticket and this time it reopened it once I added the comment to a resolved issue. The log now shows successful and I see the issue waiting for support. Thank you so much!
??????web request?{{webhookResponse.body}}????????web request????????
Asked by Ops Linux:

???????????{{webhookResponse.body}}????????????????????????????????????????????json?????

??curl command????

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

?????????

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

????????????{{webhookResponse.body}}??????????![???.png](https://community.atlassian.com/t5/image/serverpage/image-id/178924i623BC9356C52E9D3/image-size/large?v=v2&px=999 "???.png")


Answers:
author: Simmo
body: Hi [@Ops Linux](/t5/user/viewprofilepage/user-id/4719806),

This looks like it should work. Can I suggest you open a support ticket so that we can investigate further?

Cheers,

Simeon.

comments: author: Ops Linux
body: ???[@Simmo](/t5/user/viewprofilepage/user-id/3608665)   

I have solved the above problems. I changed my method. I can print {{webhook_response. Body}} in the comment area. Although it has been solved, there are still some problems with the intelligent value reference between the two send web requests. I'm not sure whether it is caused by the bug of JIRA automation itself


author: Simmo
body: What is the issue you're facing, can you provide some examples please?
JQL query for the number of tickets in the same lease / statuses
Asked by Micah Barnott:

Hey all,

I can't seem to find anything on the forums that help with this but I'm trying to build a conditional response in the Slack integration that will take the current issue's Release ID and query how many other issues are inside that same Release ID and that have a certain Status ID.

Basically getting an "**X** of **X** of Release **Y** have passed Status **Z** " response   

Has anyone seen a similar question on here or have any idea of a workable answer?

Thanks!!


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

Are you using automation for Jira to do this messaging to Slack, or something else?

If you using automation for Jira, would you please post an image of your rule for context? That may help the community to offer suggestions. Thanks!

Until then...When you note the "release ID", do you mean the ID value of the version (release) in the fixVersion field? If so, you could use the automation action of Lookup Issues with JQL to match the fixVersion to other issues and show the issue count with {{lookupIssues.size\|0}}

Kind regards,  
Bill
Copying custom fields to new ticket via automation
Asked by Mark:

I realise there are two or three previous threads on this but I've (carefully) applied their advice and it's still not working :D

I'm automating creating a new ticket when a ticket changes workflow status. I want to copy across a custom field with a numeric value to the new ticket. Here's the code I'm using:

*** ** * ** ***

{  
"fields": {  
"parent": {"id": "28996"},  
"customfield_10413":"{{issue.customfield_10413}}"  
}  
}

*** ** * ** ***

(The "parent" setting is irrelevant but included just so you can see the full code)

In the automation logging, I get the following error:

##### Create issue {#toc-hId-2012781601}

Error creating issue  
Specify a number for the custom field (below 100,000,000,000,000) (customfield_10413)

In the names page for the ticket, the custom field value appears as follows:

```
"customfield_10413":4.0
```

Can anyone advise please?


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

Have you tried using this syntax to get the value of the field: {{issue.customfield_10413.value}}

Kind regards,  
Bill

comments: author: Mark
body: Hi Bill, thanks for your reply. Tried that a few times yesterday, just tried it again and got the same error message.


author: Mark
body: ![Screenshot 2022-01-21 080542.png](https://community.atlassian.com/t5/image/serverpage/image-id/178954i58862A5AAC60584C/image-size/large?v=v2&px=999 "Screenshot 2022-01-21 080542.png")![Screenshot 2022-01-21 080554.png](https://community.atlassian.com/t5/image/serverpage/image-id/178955i27BD75F24B8D777F/image-size/large?v=v2&px=999 "Screenshot 2022-01-21 080554.png")


author: Mykenna Cepek
body: First, confirm that the type of this custom value is indeed numeric.

If so, I suspect the value (to the right of the colon) should not be quoted. See:

<https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Using-smart-values>

Consider testing this by hardcoding the JSON with a simple number, to see if that works. If it does, then focus on the smart value syntax for the value (without quotes).

```
"customfield_10413": 4
```


author: Mark
body: That's the one! Must have been the one combination I never tried - thank you so much!
Is there a full working example of share-ci-config
Asked by Amyn Sheriff:

Atlassian has couple of write-ups on sharing pipeline steps across repos (in the same workspace). But both of them end without including a concrete example of how the imported pipeline steps can be triggered.

<https://bitbucket.org/blog/share-ci-config>

<https://support.atlassian.com/bitbucket-cloud/docs/share-pipelines-configurations/>

Is there an example with actual trigger of the shared pipeline?

Thanks.


Answers:
author: Syahrul
body: G'day, [@Amyn Sheriff](/t5/user/viewprofilepage/user-id/5445500)

Can you explain what trigger you are looking for? Are you looking for the following trigger in our [blog](https://bitbucket.org/blog/share-ci-config):
> You can now trigger `importing-pipeline` in `importing-repo` and it will use the configuration from the exported pipeline config.

If yes, what this means is that you can now run the pipeline build in another repository that you want to use the share config. You can simply run the pipeline normally as long as it has the following config in the YML:

```
pipelines: 
 custom: 
   importing-pipeline: 
     import: shared-pipeline:master:shared-pipeline-config
```

Let me know if this is not what you were looking for.

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud
Substack (or similar) integration? Giving repo access to subscribers?
Asked by Richard Schilling:

Hello,

I would like to provide repo access to people who either a) subscribe to my Substack newsletter, or b) pay me a subscription fee on another platform.

Is there an API or integration that will allow me to do that? If I have to consider a specific subscription platform I have to use then that's fine just let me know what it is.

Perhaps using Repository Access Tokens are the answer here? I would just need to see an example of how to best setup the integration.

Thanks!


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

While there's not an out-of-the-box integration that would automatically grant access to a repo based on a third-party platform, you have the option to use the [Bitbucket Cloud invitation API endpoint](https://support.atlassian.com/bitbucket-cloud/docs/invitations-endpoint/) to invite a particular user to a repository based on their email.

You could then create a script/automation that is triggered when a user subscribes to your Substack, which will then invite that user's email to the repository using the invitation API mentioned above.

For further details and examples on how to use that endpoint, you can refer to its official documentation below :

* [invitations Endpoint](https://support.atlassian.com/bitbucket-cloud/docs/invitations-endpoint/)

Thank you, [@Richard Schilling](/t5/user/viewprofilepage/user-id/4304757) !

Patrik S


Tags: bitbucket-cloud

cloud
Need to trigger GC on our trimmed bitbucket repo
Asked by jayaramanm:

We did git-filter-repo to remove large files from my repository history. Even though the local size on the disk is reduced, after doing "git push -f", the size shows more than the initial size.

On researching online, we found that we need to trigger garbage collection on the repo to remove the dangling commits. Can anyone from bitbucket team please help in triggering garbage collection ?   

Please let us know what's the best way to share the repo details   
Repo details - "AirWatch Server_1/Canonical"


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

Welcome to the community!

I can't locate any repository name based on the repo details given. Could you share the full URL so I can search and trigger the Git GC on our end?

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud
How to deploy multiple lambdas residing in a single repo using bitbucket pipelines?
Asked by Lipi Lapsiwala:

I am trying to deploy multiple lambdas via bitbucket pipeline.   
The code for all the lambdas reside in a \`lambda/\<lambda_name\>\` folder in the bitbucket repository.   

With bitbucket pipe, it just deploys one lambda. Can someone help in figuring out how to deploy multiple lambdas via similar process?


Answers:
author: Aron Gombas _Midori_
body: I think all you have to do is adding multiple "pipe" sections to your Bitbucket pipeline definition.

Look at this page to see samples where it deploys Lambdas to multiple environments (staging and production, e.g.): <https://bitbucket.org/atlassian/aws-lambda-deploy/src/master/>

I'd think that deploying multiple Lambdas to the same environment should be done similarly.


Tags: bitbucket-cloud

cloud
Bitbucket Branch Restrictions
Asked by Elena Dzhordzhilova:

Dear Bitbucket Community,

I would want to ask if you have any information about branch restriction where I need 2 approvals for PRs:  

- 1 of the approvals must be from "default reviewers"

- 1 of the approvals can be from anyone who can access the repository.  

and if there are two approvals, anyone who has access to the repository, to be able to merge or if there aren't enough approvals, only the default reviewers to be able to merge.  

The configs which I tried were:  

- **From:** Repository Settings -\> Branch restrictions -\> Actions (on the desired branch) -\> Edit -\> Merge Settings -\> Minimum number of approvals **(2)** and Minimum number of approvals from default reviewers **(1) ,**because if one approval is set from default reviewers it will be also counted in "Minimum number of approvals". Also set "Prevent a merge with unresolved merge checks" to prevent merges if the approvals are not enough, but everyone will be able to merge, but in this case, the default reviewers cannot merge without all approvals too. If I set restriction in "Branch Permissions" inside the list "Merge access via pull request", then only the whitelisted users will be able to merge which is not what I need and if "Prevent a merge with unresolved merge checks" is enabled, it will also avoid merge, even if the users are with "Admin" permissions for the repository.

Best Regards,

Elena


Answers:
author: Theodora Boudale
body: Hi Elena,

The closest thing to what you are asking is the following:

* Set Minimum number of approvals (2) and Minimum number of approvals from default reviewers (1)
* Set "Prevent a merge with unresolved merge checks"
* Give write access to the destination branch (from the branch restriction, option **Only specific people or groups have write access**) to the users you have as default reviewers

The default reviewers will not be able to merge the PR that doesn't have the necessary number of approvals.

However, they will be able to:

1. Go to the **Branches** page of the repo
2. Select the source branch of the PR on this page
3. On the new page that opens there is an option to **Compare** with a certain branch. They can choose to compare with the destination branch of the PR
4. Afterwards, they can select the **3 dots** (on the left of the **Settings** button) \> **Merge**

If they merge the branches this way with merge strategy Fast forward or Merge commit, then the PR is also going to be marked as merged automatically.

Please keep in mind that if you give the default reviewers write access to the destination branch via the Branch permission, they will be able to merge the branches even when there are zero approvals in the PR and also push to the branch.

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

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
How exclude specific folders to update on the server with rsync pipeline
Asked by Marcos Almeida:

Hello,  

I am using rsync pipeline to deploy to my server, but it happens that essential information like the content is being replaced by the dummy content I have in my local.  

*** ** * ** ***

pipelines:  
branches:  
main:  
- step:  
name: Deploy to production  
deployment: production  
script:  
- pipe: atlassian/rsync-deploy:0.8.1  
variables:  
USER: $USER  
SERVER: $SERVER  
REMOTE_PATH: $REMOTE_PATH  
LOCAL_PATH: "${BITBUCKET_CLONE_DIR}/"  
EXCLUDES: ".gitignore"  

*** ** * ** ***

<br />

Also I realised the obvious that if I include the content folders in my .gitignore, I would remove them totally from my server. Which is not intended?  

Is there a way to the pipeline ignore updating specific folders, as i want to keep them untouched on my server? The content folder on my root, for example.  

This, of course, respecting what I have in my .gitignore  

Thanks


Answers:
author: Hariharan Iyer
body: Hi [@Marcos Almeida](/t5/user/viewprofilepage/user-id/5137414) ,

You can use the EXTRA_ARGS parameter to pass in the "filter" and/or "exclude" parameter to rsync. For example

```
script:  - pipe: atlassian/rsync-deploy:0.12.0    variables:      USER: 'ec2-user'      SERVER: '127.0.0.1'      REMOTE_PATH: '/var/www/build/'      LOCAL_PATH: 'build'      DEBUG: 'true'      EXTRA_ARGS:        - "--filter=P assets/css" # double quotes here are necessary        - "--exclude=*.txt"
```

Hope that helps!

comments: author: Hariharan Iyer
body: Also, if you want the contents of .gitignore to be ignored, you will have to use

```
--exclude-from=.gitignore
```

in the EXTRA_ARGS section.


author: Marcos Almeida
body: Hey [@Hariharan Iyer](/t5/user/viewprofilepage/user-id/5124435)   

Thanks a lot for the fast answer.  

It drives me to another question: Filter or exclude flags would drive me to the same, not touching my folders on the server?  

Would it look like this?  

```
EXTRA_ARGS:        - "--filter=P content" 
        --exclude-from=.gitignore
```

comments: author: Hariharan Iyer
body: Yes, using excludes (or exclude-from) in rsync implies that files which match those patterns will not be sync'ed, so the versions on your server should not be affected. You can learn more about how/when to use the various options here - <https://manpages.ubuntu.com/manpages/trusty/en/man1/rsync.1.html#filter%20rules>


author: Marcos Almeida
body: Perfect! Thanks a lot!


Tags: bitbucket-pipelines

cloud
Pull Request API or APP for Metrics
Asked by sangsub.kim:

I am considering some SW Metric information based on Bitbucket.

If you have any API or app information, please let us know.

1.Time to Merge  
- Time from Pull Request to Merge

2. Pull Request Size  
- File (Code) Size (Line?) for Pull Request


Answers:
author: Uladzislava Kastsitsyna _Stiltsoft_
body: Hi [@sangsub.kim](/t5/user/viewprofilepage/user-id/3444509)

I am Vlada from the [Awesome Graphs for Bitbucket](https://link.stiltsoft.com/u7bkc1) team and I wanted to share that Cycle Time information is now available in our [REST API export](https://docs.stiltsoft.com/awesome-graphs/data-center/release-notes-data-center/awesome-graphs-6-3-0). Here is an example of an output you can get:

![](https://docs.stiltsoft.com/awesome-graphs/files/data-center/179143060/179143078/1/1716274962684/prs-w-cycle-time.png)

As you can see, besides total cycle time, it contains a breakdown into phases. It seems that Time to Resolve might be particularly interesting to you.

Let me know if you have any questions!

Best regards,  
Uladzislava


Tags: bitbucket-data-center

data-center