youngmon/atlassian-qna huggingface dataset:
How to structure a nice JSON for a web hook callout
Asked by Stuart__:

In my automation I have a REST API callout with this payload spec, interested in issue comments

{  
"webhookEvent": "issue_commented",  
"timestamp": "{{issue.updated.setTimeZone("UTC")}}",  
"eventData": {  
"target": "XXX",  
"comments": \[  
{{#issue.comments}}  
{ "author": "{{author.displayName}}",  
"createdAt": "{{created.setTimeZone("UTC")}}",  
"body": "{{body}}"},  
{{/}}  
\]  
}  
}

Two or 3 things. There is no consistency in time (I need a Tardis) between the issue updated date and time (usually 4, 5 o rsometims6 hours after the comment createdAt date and time).

There doesn't seem to be a way to prevent the final trailing ',' when the list of comments is exhausted.

E.G. I want

{ "webhookEvent": "issue_commented", "timestamp": "2021-02-03T19:27:10.8+0000", "eventData": { "target": "XXX", "comments": \[ { "author": "Stuart__", "createdAt": "2021-02-03T14:36:03.7+0000", "body": "Stuart test 1, 2, 3 and 4 and 6 and 7" }, { "author": "Stuart__", "createdAt": "2021-02-03T18:51:34.9+0000", "body": "\* B1 \* B2 \* B3" } \] }}

But get { "webhookEvent": "issue_commented", "timestamp": "2021-02-03T19:27:10.8+0000", "eventData": { "target": "XXX", "comments": \[ { "author": "Stuart__", "createdAt": "2021-02-03T14:36:03.7+0000", "body": "Stuart test 1, 2, 3 and 4 and 6 and 7" }, { "author": "Stuart__", "createdAt": "2021-02-03T18:51:34.9+0000", "body": "\* B1 \* B2 \* B3" }++**,**++ \] }}

Are there any hints on formatting webhook payload as nice JSON?

Thank you.


Answers:
author: Hana Ku?erov?
body: Hi [@Stuart__](/t5/user/viewprofilepage/user-id/1621458) ,

according to the final trailing - please try something like this:

{{#issue.comments}}  
{"author": "{{author.displayName}}",  
"createdAt": "{{created.setTimeZone("UTC")}}",  
"body": "{{body}}"}{{\^last}},{{/}}  
{{/}}

You can find more [here](https://support.atlassian.com/jira-software-cloud/docs/smart-values-lists/).

comments: author: Stuart__
body: Perfect, thank you.


Tags: cloud
Getting error when trying to match a multiselect dropdown to Fix Versions
Asked by Alex Degregori:

When trying to connect a custom multiselect dropdown field to the Fix version field via automation, I receive an error: ![Screen Shot 2021-02-02 at 5.46.34 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/128518i69038E594CC762B7/image-size/large?v=1.0&px=999 "Screen Shot 2021-02-02 at 5.46.34 PM.png")

The Fix versions and the multiselect dropdown fields have the same values and are apart of the same project which is odd. I was able to automate these fields together when using a single field but needed to change the automation code to account for multi selections.   

Here is a screenshot of my automation set up:

![Screen Shot 2021-02-02 at 5.49.16 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/128520iFFFF701D066A369A/image-dimensions/163x222?v=1.0 "Screen Shot 2021-02-02 at 5.49.16 PM.png") ![Screen Shot 2021-02-02 at 5.50.04 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/128519i5AABAEF95A7FFF91/image-size/large?v=1.0&px=999 "Screen Shot 2021-02-02 at 5.50.04 PM.png")

Any idea what the issue might be here? Thanks for any help in advance! ??


Answers:
author: Bill Sheboy
body: Hi [@Alex Degregori](/t5/user/viewprofilepage/user-id/4059794)

Looking at your rule, when the Custom Sprint field changes, you are trying to set the Fix Version to the previous values of the Custom Sprint field. Is that correct?

First thing, I suggest putting in an audit log action for the value you are trying to set to the Fix Version. That will confirm if the value is indeed a value version.

Next, you note the Custom Sprint field is multiple selection and you are using the changelog syntax. Are you expecting multiple values in the Custom Sprint field to be set to Fix Version? If so...

* I have not nested list functions before (changelog and custom field). Writing to the audit log, as I noted earlier, should help see if that works.
* If it does, you will need to make the list of values comma-separated in order to set the Fix Version, but you have a single set of quotation marks around the listed values. With nested lists you may need to experiment with that, perhaps using split and join to wrap the items properly.

Best regards,

Bill

comments: author: Alex Degregori
body: Hey Bill! Thanks for the extra context. I actually [posted this](https://community.atlassian.com/t5/Jira-Core-questions/Getting-error-when-trying-to-match-a-multiselect-dropdown-to-Fix/qaq-p/1599892#U1600945) in the generic Community question pool and got an answer there. So I'll close this out as answered as well.
Automation rule - Add epic link
Asked by Audrey Artis:

Hello,

I'd like to get some help with an automatic rules I'm trying to implement, hope you can help :) Here is the situation:

- I have a manual trigger in one of my project to create Enabler stories in ANOTHER project

- Those enabler stories are created in the project B and automatically linked to the original task/story/bugs etc. from project A with the mention "implements"

- On those enabler stories (from project B) I would like to add a condition to automatically add the Epic link and it should be the same epic link than the one from the project A

I hope it's clear :) Hopefully one of you could help me with that !  
Thanks a lot anyways!


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

You are describing a case where you want to trigger a rule from one project, create a new issue, and link it to an epic in the original project. Is that correct?

If so, you definitely can do this with an automation rule. Because this rule touches multiple projects, it will need to be a global rule. There are limits on global rule execution counts so please check with your site admin for information.

Are you planning on executing this rule from the Epic or from a Story that is linked to the Epic?

For the first case, your rule would be something like this:

* Trigger: manual
* Condition: issue type equals Epic
* Action: create issue, setting the summary and any other fields. To set the epic link, select the source as Current Issue

If you instead trigger the rule from a Story linked to the Epic, the rule would be:

* Trigger: manual
* Condition: issue type is one of Bug, Story, Task
* Related Issue Condition: epic exists
* Branch: on parent epic
  * Action: create issue, setting the summary and any other fields. To set the epic link, select the source as Current Issue

Best regards,

Bill

comments: author: Audrey Artis
body: Hey Bill,

I have already configured the first rule with the manual trigger.

The part I'm missing is the automation to add an epic link to the enabler story.

The epic link for the enabler story should be the same than the story that triggered the creation of the enabler.

Thanks for your help!


author: Bill Sheboy
body: Hi Audrey,

Please try to set the Epic Link to the **Current Issue** when you create the new one.

If that works for you, please consider marking this question as answered. That will help others in the community find solutions to similar questions faster.

Thanks,

Bill


author: Eloi Le Roux
body: disregard this message, I resolved my issue


author: Jonathan Domanus
body: how?
Script runner for EMAIL
Asked by Madhu:

Hi Team,

I need a help

We have work flow and in escalation we have 3 different transitions ESC-1 ,ESC-2,ESC-3

for each escalation we have 3 different screens and 3 different fields

I need to send an email to 3 escalation level for 3 different persons.

In post function I need to write a script for the filed, please help me for writing for this script in script field.


Answers:
author: Madhu
body: i am the new to script runner if you have any references please share


author: Ravi Sagar _Sparxsys_
body: Hi [@Madhu](/t5/user/viewprofilepage/user-id/2684961)

There is a script post function to send a notification. Have you tried using it?

Ravi


Tags: cloud
Coping Due Date from End Date
Asked by Vera Bakshaeva:

Hello!

Could you please help to create a rule which will copy due date field from end date field?

I have created two rules:

1. Changing due date when the issue is created.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/127968iF441AFCBFB2C972A/image-dimensions/207x203?v=v2 "image.png")

It works. The timeline in roadmap changed.

2. Changing due date when the issue is idited.

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

A rule does not work(

When I change the the end date of issue there is no changes in roadmap.

P.S. I need this option to see the changes of issues in Jira roadmap (Standart cloud version).

Best regards,

Vera


Answers:
author: Dirk Ronsmans
body: hi [@Vera Bakshaeva](/t5/user/viewprofilepage/user-id/3561329) ,

why in your second rule are you using that For statement? I fail to see the added value as the rule will trigger on the current issue already.

could you remove that part of the rule first and see what happens?

comments: author: Vera Bakshaeva
body: Thank you very much!

I have changed. It works.

But it is actually only for epic, for the task, it doesn't work because we do not have a timeline for the task.

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


author: Dirk Ronsmans
body: Hi [@Vera Bakshaeva](/t5/user/viewprofilepage/user-id/3561329) ,

I don't fully follow what you mean with the Task part.

But if you need to do this only for certain issue types you could include an IF condition before the Edit (it's a separate component) where you allow it only for specific issue types.
Manage Sprints: Project permission not working
Asked by Fred:

I have two scrum boards in the same project. 'Grp-EngLeads' has the permission to Manage Sprints. This is a project-wide setting, but people in that group are only able to manage one of the boards. What am I overlooking? Filters and boards are shared and visible.


Answers:
author: Jack Brickey
body: what is unique about the second board? is it possible that it includes issues from another project? if so verify that the grp-engleads has permissions in the other project(s).

comments: author: Fred
body: There's nothing different between the two of them, which is perplexing. They're both the same prefix, with a different option selected from a dropdown to designate a team.

project = ABC AND "ABC Team\[Dropdown\]" = "Team One"

and

project = ABC AND "ABC Team\[Dropdown\]" = "Team Two"


Tags: permission
How to add issues as child to a specific issue if Automation is used?
Asked by Christian Horn:

Hi all, we set up a Structure that uses Automation (because Automation can sync issues managed by Plan (former Portfolio)). Now I would like to have in addition issues without any link to be added as child of a specific issue. For this I would have to use a Synchronizer because it seems that Automation can't do this.

I set up a Sychnonizer but nothing happens (it works if I define a Structure with the Synchronizer only).

So, it seems that Automation and Sychronizer can't be used in parallel in the same Structure.

Any ideas how to solve this?

Thanks


Answers:
author: Stepan Kholodov _ALM Works_
body: Hello Christian,

Synchronizers indeed can't work with generators since they can't recognize dynamic content.  
If you want to link new issues with the Parent link, then you can just open the Double Grid in your structure, search for issues you want to add and then drag and drop them to your structure on the left under respective parent issues. The existing Extend generator for adding issues with the Parent link will create this link between the parent in the structure and issues that are being moved under it. You can also create a different link in Jira between such issues if you want by having another Extend generator in the structure configured to a different link type.

I hope this helps. If you need further assistance, please contact us directly at support.almworks.com so we could take a look at your set-up in more detail.

Best regards,  
Stepan Kholodov  
ALM Works


Tags: addon-com.almworks.jira.structure
How to comment an subtask when another subtask is in the status done.
Asked by Atlassian:

Hi everyone,

we have a automation that create 3 Subtasks. (dtp, grafik and video).

We need a comment on the dtp sub task when the grafik subtask is transition to done.

I try several things but it doesnt work and the audit log told me every time :

NO ACTIONS PERFORMED


Answers:
author: Nic Brough -Adaptavist-
body: "I try several things but it doesnt work" gives us nothing to work with.

All I can tell you is "use an automation or scripting app to do it"

comments: author: Atlassian
body: Ok sorry.

we use the "Automation for Jira" App.

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


author: Atlassian
body: Ok i have found the answer after 2 Hours :-P

The Answer is:

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


author: Nic Brough -Adaptavist-
body: Ok, so this automation rule says:

When a "CDN Grafik" issue is transitioned to done, if its parent issue has at least one subtask of type "CDN DTP", then add a comment to the parent issue

"no actions performed" means that the "if" conditions in there are not being met.
User Story and Bugs only assigned to a particular person?
Asked by Muthu:

Hey Hi,  
I want to automate this particular scenario.  

1\] Only the User Stories and Bug's is transited to particular Column (In review) from other columns (To Do, In Progress, Blocked and Done) it should automatically assign to a particular person in the board,  

2\] When the Bugs or User Story moved to a particular column (Blocked) it should automatically to the person who changed to Column (In review) or Who was assigned to the task (InProgress).


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

Automation rules for what you ask are possible, with some help from custom fields. For example, you would need a field to store who was assigned when InProgress for your (2) rule.

I suggest looking at some examples and the documentation, try to create your rules, and then if you have problems post back here for help. Here is some documentation to get you started:

<https://www.atlassian.com/software/jira/automation-template-library#/label/all/1453>

<https://community.atlassian.com/t5/Automation-articles/Jira-Automation-all-the-resources-you-need-in-one-page/ba-p/1388465>

<br />

Best regards,  
Bill

comments: author: Muthu
body: Sure [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) will look into it,  
Thanks for giving me the idea.
Automation: Ticket added to Epic
Asked by Fred:

I'd like to receive an email when tickets are added to an epic. What's the best way to set this up?

I have the following:

When: Issue created

Parent is not empty

Then: Send email


Answers:
author: Darryl Lee
body: If your only parent type is Epic, I believe that should work.

Are there any additional constraints? Is it only \*you\* that should be receiving emails? Or maybe the current Epic assignee? If you wanted that, you could add {{issue.parent.assignee}} to the list of recipients.

Also, it might be nice to have a link in the email to both the new issue and the epic, so something like:

```
A new issue has been added to Epic <a href="{{issue.parent.url}}">{{issue.parent.key}} - {{issue.parent.summary}}</a>:

<li><a href="{{issue.url}}">{{issue.key}} - {{issue.summary}}</a>
```

And you'd probably want to put issue.key and issue.summary in the Subject: line.


author: Jack Brickey
body: I think I would do the following...

Trigger: Issue created

Condition: JQL - type not in (epic, sub-task) \& "epic link" is not empty

Then: Send email

adjust condition to meet your config


author: Fred
body: Awesome, thanks guys!
Moving ticket to another project and emailing the new ticket
Asked by Tudor Lala:

Hi,

I am looking at moving a ticket created in the SD portal to another project and emailing the requester the new ticket number so they can access the ticket in the new project.

I created a clone and delete automation but i need help with the email part.

Thank you


Answers:
author: Sherry Goyal
body: Hello [@Tudor Lala](/t5/user/viewprofilepage/user-id/1695937)

You can achieve this by using "branch - Most recently created" after clone action and smart values in "Send email" action.

Something like:

![Screen Shot 2021-01-20 at 11.16.24 am.png](https://community.atlassian.com/t5/image/serverpage/image-id/126365i6447D556704F6B27/image-dimensions/550x311?v=v2 "Screen Shot 2021-01-20 at 11.16.24 am.png")

I used:

{{triggerIssue.reporter.emailAddress}} to access reporter's email address in original ticket

{{triggerIssue.reporter.displayName}} to access display name of reporter to mention in email body.  

{{triggerIssue.key}} will mean original issue key

{{issue.key}} means the newly created ticket by clone action.

Then you can use "Delete action" outside branch to delete issue.

Sharing some useful links: [smart values](https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/) and [branch rule/related issues.](https://support.atlassian.com/jira-software-cloud/docs/work-with-related-issues/)

Hope this resolves the concern.  

Cheers  
Sherry

comments: author: Tudor Lala
body: this works perfectly, thank you.

The last bit that is optional but desirable would be to transfer a radio button selection ( Normal priority/Urgent ) . I have the custom field, the JQL to find it, i need some help editing the priority in the created clone.


author: Sherry Goyal
body: [@Tudor Lala](/t5/user/viewprofilepage/user-id/1695937) You should be seeing that field in dropdown inside "clone issue" where you can set its value. Let me know more details about the use case what exactly you want to set and maybe share your rule too. Will help me in understanding what exactly you are after.


author: Brant Schroeder
body: Tudor,

You should just be able to add a public comment on the issue and the user will get an email. You maybe running into a licensing issue if you are going from a service desk project to a software or core project. In order to get communications and see the issue on a software or core project the user will need to be licensed.


author: Alex Carias
body: The Clone issue and email worked but the cloned issue is not bringing over information from a form that is used in the request type.
Can Automation for Jira (Server) transition issues based on BitBucket pull requests?
Asked by Elizabeth Dutton:

I know there is functionality on Jira Cloud but not on Server, so is there another way to do this?


Answers:
author: Darryl Lee
body: Hi - I think you'll have/want to use Incoming webhooks:  
<https://confluence.atlassian.com/automation/triggers-993924804.html#Triggers-incomingwebhookIncomingwebhook>
> **Incoming webhook**   
> \* Available in Server Lite: No  
> \* Related smart values: {{webhookData}}
>
> A webhook is a way for a third party to trigger an Automation Rule. The webhook can specify specific issues to act on or even provide Automation for Jira with real-time data that you can use to update your issues. We have some great examples on how we have used webhooks in our blog:
>
> \* Triage customer feedback and add a slack notification  
> \* How to use Automation for Jira to improve Continuous Delivery  
> \* Integrate Jira and GitHub.

---

Then you'll need to set up BitBucket PRs to trigger that webhook you setup:

Server: <https://confluence.atlassian.com/bitbucketserver/managing-webhooks-in-bitbucket-server-938025878.html>  
Cloud: <https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/>


Tags: bitbucket

jira-server
Create a commit - Bad Request (400)
Asked by Hassan Ahmed:

We are using the bitbucket rest API to commit files by sending a POST request using the following [endpoint.](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source#api-repositories-workspace-repo-slug-src-post)

For some of the requests, the response we receive is "Bad Request (400)" with no additional information around what could have caused the request to fail. I acknowledge the fact that this error code means that the request is malformed but in our case, we haven't been able to identify a pattern that could raise this error since its not the case for every single request and having no additional information around the error makes it even difficult to narrow down to the origin of the issue.

To be able to diagnose this issue further on our end, would it be possible to have some additional information/context along with the error message via some sort of settings maybe a debug mode? That would give a clue around what could have been a potential cause behind the request being rejected.

Via some internal logging we have in place, I can see files being attached to requests before its dispatched in each case, number of files can be from anywhere between 50-200 (but I don't think thats the issue).

For some additional context we have a service that triggers this API call, having form fields to hold information like files, commit message, author and branch.

<br />

This is the error we receive at the moment:

![Screenshot 2024-01-29 at 18.21.14.png](https://community.atlassian.com/t5/image/serverpage/image-id/303094iB5929C554A85A27E/image-size/large?v=v2&px=999 "Screenshot 2024-01-29 at 18.21.14.png")


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

Welcome to the community!

I believe your questions are better posted in the A[tlassian developer community](https://community.developer.atlassian.com/c/bitbucket-development/bitbucket-cloud/13) as they relate to customization.

Regards,  
Syahrul

comments: author: Hassan Ahmed
body: Hi, thanks for pointing me in the right direction, will post on devs forum as well.


Tags: bitbucket-cloud

cloud
Workspace ID is unavailable
Asked by Halil Enver Soylu:

I have created hesventures.atlassian.net in Jira. Then I have tried to create a bitbucket with Workspace ID "hesventures" but it gave "We cannot fullfil your request right now" error.

Then I tried to create a bitbucket account from bitbucket.org directly. But this time it did not allow me to take "hesventures" as Workspace ID. instead I was able to take "hes-ventures".

I doubted that "hesventures" somehow taken by the system when I tried to create it from Jira, but I cannot use it now.

Can you please check if "hesventures" is not available for me because of some bug or it is really taken by someone else?


Answers:
author: Syahrul
body: G'day, [@Halil Enver Soylu](/t5/user/viewprofilepage/user-id/5417396)

Welcome to the community.

Based on my observation, I believe you can't create a Bitbucket workspace with that name because it's currently used as your Bitbucket username. You'll need to use a different username to free it up and use it for your workspace.

Please find the guide below on how to update/change your username:

<https://support.atlassian.com/bitbucket-cloud/docs/update-your-username/>

Let me know how it goes.

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud