youngmon/atlassian-qna huggingface dataset:
Jira automation based on Bitbucket's Pull Request approval status
Asked by Pawe? Wi?niewski:

Hello,

I'd like to create Jira automation (moving issue from one column to another) based on the approval status of connected PR. So for example if PR is approved, automation is run, and the task is moved to "waiting for merge" column. Similarly, "request changes" would move the task to "To be fixed" column.

Is there a way to do this? I have so far:

* discovered there is no trigger like this in automation,
* learned that Jira's custom integration, receiving POST requests, is incompatible out of the box with bitbuckets webhooks, as the latter won't allow customizing payload, and it's format is not what Jira expects (or at least that's what I understand from the docs).

So it looks to me at this moment, that the only possibility is to have a custom, separate endpoint set up, which will accept bb webhooks, process it, and then send another request to Jira - which obviously is not something I want to do for this relatively straightforward task I want accomplished.

Is there any other way to achieve what I want?


Answers:
author: John Paul Wilkens
body: I don't believe it's possible with the current automation rules. I've been looking / waiting for this feature for a couple years. Would be nice to see it, or see if someone has figured out a webhook solution.

comments: author: Grzegorz B?k
body: Same here! I'm looking at how to trigger automation when a pull request is approved or changes are requested.
How to place a new page at the top of the parent page when automating page creation?
Asked by zhaoxiang_daqiao_:

Hello Community

When I create a new page using automation, by default the new page is placed at the very bottom of that parent page.

But I personally like to put new pages at the top of the drop-down list so I can quickly find the latest documents.

Please tell me how I can set it up in automation to achieve my needs. Thanks!


Answers:
author: Pramodh M
body: Hey [@zhaoxiang_daqiao_](/t5/user/viewprofilepage/user-id/5387084)

Currently, there isn't any way through the Automation.

I checked the API and it's a bit tricky!

Find the approach below

First, get the descendant of the parent page using the below API

You must know the parent page ID when you call an API via automation

<https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---children-and-descendants/#api-wiki-rest-api-content-id-descendant-get>

```
curl --request GET \ 
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/descendant' \ 
--user 'email@example.com:<api_token>' \ 
--header 'Accept: application/json'
```

Once you get the first descendant, store the ID of the descendant page ID

Then call the API to reorder the newly created page at the top (here you must know the Page ID of the newly created page via automation

<https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---children-and-descendants/#api-wiki-rest-api-content-pageid-move-position-targetid-put>

```
curl --request PUT \ 
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{pageId}/move/before/{targetId}' \ 
--user 'email@example.com:<api_token>' \ 
--header 'Accept: application/json'
```

Thanks,  
Pramodh

comments: author: zhaoxiang_daqiao_
body: Hi Pramodh  
Thanks for the reply. This is a bit beyond my capabilities. I'd better wait for the official to improve the relevant automation functions. Anyway, thank you very much!?
How are the loop are detected in Jira Automation? false positive on loop detection
Asked by Fernand Ly:

Hello !

I made a set of automation based on a form, which trigger a cascading effect of multiple automation (up to 26)

Jira Automation detect this as a loop even if all rules are different and don't repeat.

Are any workaround exist ?

Can we not get the loop threshold change ?


Answers:
author: Bill Sheboy
body: Hi [@Fernand Ly](/t5/user/viewprofilepage/user-id/2744149)

Adding to Jack's answer, it is difficult to know the cause of looping for your rules unless you describe the scenario fully (i.e., the problem you are trying to solve), show the complete rules' images / structure, and the rule details for options.

Until we know that information...

Reading the documentation on automation service limits, we find this information:   
<https://support.atlassian.com/cloud-automation/docs/automation-service-limits/>

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

This states rules which trigger themselves, or through the "Allow Rule Trigger" option lead to triggering other rules, are counted as looping.

These cascading scenarios quickly become problematic when there are many issues in a chain of execution, or a rule error is leading to looping. And...there is another possible risk of such rule designs: when there is an automation engine (or Jira Cloud) outage, there is no stated information from Atlassian that the rules will eventually trigger correctly...leading to significant manual cleanup of issues. (My understanding is eventual triggering after an outage appears to depend on the rule designs and the events involved.)

When many cascading fields of information are needed, please consider alternative solutions, alternative rule designs, or marketplace addons for such field updates.

Kind regards,  
Bill


author: Jack Brickey
body: Hi [@Fernand Ly](/t5/user/viewprofilepage/user-id/2744149) , could you explain a bit about your used case and what you are attempting to achieve? It is hard to come up with a workaround without really understanding this information.


Tags: cloud
Monthly Quarterly automation combination
Asked by Roy Wood:

I need an automation that creates an issue every month, however every 3 months the issue being created needs to have some additional quarterly information on it.

I can create an automation that runs every month.

I can create another than runs every 3 months.

However 4 times a year i will get a monthly issue alongside a quarterly one and I don't want that.

Is there a way to make an automation run Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec?


Answers:
author: Roy Wood
body: I thought about it more and saw an example where something runs on Mondays and Wednesdays and adapted it)

Run at 1am on the 1st of the month, every month (except for quarterly months)

0 0 1 1 'Jan, Feb, Apr, May, Jul, Aug, Oct, Nov' ?

Run at 1am on the first of the month every 3 months starting from January

0 0 1 1 1/3 ?

Does this seem sensible?


Tags: jira

jira-software

jira-software-server

server
Cannot past webhook URL into Teams action
Asked by Andras M:

Hi,

I would like to set up a notification to MS Team with webhook.

When creating the action, it is not possible to paste the webhook URL, because the field is not an input type, but a selection (dropdown) with text: "Select one"

(and the list offered only contains a link to a Slack webhook)

![select-one.jpg](/t5/image/serverpage/image-id/296388i780E51833E772F83/image-size/large?v=v2&px=999 "select-one.jpg")

Why I cannot paste the link (as the documentation says)?

Thank you


Answers:
author: Xavier Tang
body: Hi thank you for your information. I had the same concern, and it's not clearly indicated in Documentation. Your self answer helpped me.

It's also necessary to include the URL in the Allowlist.


author: Andras M
body: Okay, so I'll needed to click on three-dots menu in Automation rule and open "Manage Secret Keys" and add the other link there. My bad... it is written in point 4, but not specified where you need to do that...


Tags: jira

jira-software

jira-software-server

server
Automation Rule is validating but no logs shows no action performed
Asked by Harry Brar:

Hi All,

I have created the following automation to auto-assign the tickets, and the JQL queries are validating, but the rule automation log shows- no action performed- The issue did not match the JQL condition. Please advise.

Issue is created\>\>if createdDate \> startOfDay("+0h") AND createdDate \< endOfDay("-15h")\>\>assign the ticket to X agent\>\>if createdDate \> startOfDay("+9h") AND createdDate \< endOfDay("-13h")\>\> Assign the ticket based on work load\>\>if createdDate \> startOfDay("+11h") AND createdDate \< endOfDay("+0h")\>\>Assign the ticket Y agent.

Thanks


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

Without seeing an image of your actual rule or the audit log details...

I hypothesize your rule is using if-conditions and not if-else conditions for the different cases you note. And so the rule halts after the first one. Please try using the if-else condition.

If that does not help, please post an image of your actual rule and the audit log details to provide context. Thanks!

Kind regards,  
Bill

comments: author: Harry Brar
body: Thanks Bill, I found the issue, I was supposed to use the Branch out to apply multiple conditions, It's working now.
How to create automation based on custom event?
Asked by Niklas Lamp?n:

I have created a couple of custom events, such as "Issue Ready for QA" and "Issue QA Passed". I want to run automations based on these events, but I can't see any of the custom events to be selected as a trigger.

I have multiple projects using the same workflows, and not all projects are equal in what is expected to happen when "Issue Ready for QA" happens, so just adding post-transition function is not a desired answer.

How can I achieve this?


Answers:
author: David Friedrich
body: Hi [@Niklas Lamp?n](/t5/user/viewprofilepage/user-id/4867031) , you could trigger a webhook along with your custom event as described here: <https://confluence.atlassian.com/jirakb/how-to-use-a-webhook-with-a-custom-event-779160676.html>

Automation rules can be triggered by webhooks. In this rule filter down to just the projects and issues you want actions to be performed on.

Hope that helps.

comments: author: Niklas Lamp?n
body: If I understand this correctly, this would send a JSON payload to a webhook to external system, but I would like to create Jira automation based on a custom event?


author: David Friedrich
body: Which is not possible. Hence my suggestion to send a webhook within the same transition firing your custom event.

Add a new automation rule with the trigger "Incomming Webhook". It will provide you with an URL. Copy that URL. Go to https://\<YOURSITE\>.atlassian.net/plugins/servlet/webhooks#

and create a new webhook with that URL. In your Workflow add postfunction "Trigger a webhook" and choose your new created webhook.

As I am writing this, why not have the workflow transition(s) with your custom events trigger the auto rule(s)? You can narrow down in the conditions (IF THEN) of your rule if an action should be performed depending on the issue's project.


author: Niklas Lamp?n
body: Oh, this sounds like a viable workaround. Thank you! I was not aware of the incoming webhooks setup.


author: Fazila Ashraf
body: Hi [@Niklas Lamp?n](/t5/user/viewprofilepage/user-id/4867031)

Unfortunately the custom events are not available as automation triggers at this time :(

It is not even in Atlassian's roadmap as they have resolved these suggestions as low engagement /duplicates <https://jira.atlassian.com/browse/JSDCLOUD-4461> , <https://jira.atlassian.com/browse/JSDSERVER-4461>

I recommend you to use the workarounds on "Use a post-function to set the value of a single-select list custom field (which has options to match the names of custom events). Then use the 'Field value changed' trigger in the automation rule and select the above custom field. Add If/else conditions in the rule to check the value of the custom field and perform the desired actions." or webhooks and also raise a new suggestion with Atlassian.

comments: author: Niklas Lamp?n
body: Thank you for the suggestions.


Tags: event
RestAPi Jira getepics from project but comments field is empty
Asked by Leon Stall:

Hi,

So I?m currently trying to fetch all of my epics from the project but am encountering the problem that the comments field is an empty array even tho it isn?t empty and that there are comments on the normal requested epic with the epicId.

I am using the following code:  

```
async getEpicsByProject(projectIdOrKey: string): Promise<Issue[]> {
  return new Promise((resolve, reject) => {
    this.getRestApiClient(3)
      .get(`search?jql=issuetype = Epic AND project = ${projectIdOrKey}`)
      .then(async (response) => {
        const epics: Promise<Issue[]> = Promise.all(
          response.data.issues.map(async (element: JiraIssue) => ({
            issueKey: element.key,
            assignee: {
              displayName: element.fields.assignee?.displayName,
              avatarUrls: element.fields.assignee?.avatarUrls,
            },
             comment: element.fields.comment ?? {
             comments: [],
             }
            subtasks: element.fields.subtasks,
            created: element.fields.created,
            }
       }
```


Answers:
author: Stefan Salzl
body: Hi [@Leon Stall](/t5/user/viewprofilepage/user-id/5383149)

welcome to the community.

Could you tey to add the ?fields" query parameter to your call so that the response delivers all fields

this should be fields=\*all according to the following docu:

<https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-get-request-Query%20parameters>

Best  
Stefan


author: Hana Ku?erov?
body: Hi [@Leon Stall](/t5/user/viewprofilepage/user-id/5383149) ,

welcome to the Atlassian Community!

To be able to get issue comments, you need to use different REST API endpoint, see [here](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-get)


Tags: cloud
Jira automation rule doesn't work correctly if user edits or deletes worklog
Asked by Just Me:

Hello,

I configured the rule that calculates the total of "Time tracking" on the epic level each time the user enters the value into the "Time tracking" field on its task.

The issue is that this rule doesn't work correctly if the user edits or deletes the existing work log. For example, the user logs 5 min to the task. Epic "Time tracking" reflects the correct total: previous total + 5 min. Then the user edits this existing work log on the task to be 2 min instead of 5 min -- and the rule reflects it as + 2 min to the epic total, not - 3 min as expected. The same thing happens if the user deletes the work log on the task: the rule adds the value to the epic total rather than subtracts it.

The rule's configuration:

![Rule_3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/295712iE297BCE3B9F63AD7/image-dimensions/338x463?v=v2 "Rule_3.PNG")

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


Answers:
author: Antuan Sammak
body: Hi [@Just Me](/t5/user/viewprofilepage/user-id/5380842)

the way you set it up the log work for the parent is a SET not UPDATE, meaning it will replace it always with the new value.

i think the solution for your case is to use smart values here to sum up the existing value of parent time spent with the one being added on task

please check the below link for more information about using smart values in Jira with time related fields

<https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/>


Tags: time-tracking
Jira automation rule to sum up timeSpent on Epic level
Asked by Just Me:

Hello,

I need to create an automation rule to reflect the correct total of the "Time tracking" field on Epic as a sum of the "Time tracking" values of its tasks.

I made the following configuration (the screenshots below), but it doesn't calculate the total value correctly. When I log 5 min to a task for the first time after rule activation, it returns the correct total value for epic: 4d 1h 25m. But when I log 5 min for the second time, the "Time tracking" epic field shows me an enormous value: 1w 3d 3h 5m instead of 4d 1h 30m.

I'm not sure if it's important or not: some of my tasks already had time logged on before rule activation. So I need the epic total to reflect these values as well + newly logged values.

Thanks.

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

The advanced "Edit issue fields" block is the following:

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


Answers:
author: Bill Sheboy
body: Greetings, and welcome to the Atlassian Community!

Based on what you are describing, it seems you are adding the *current total time* rather than the time which was just logged and seen by the rule trigger.

As shown here, the timeSpent smart value is the total time: <https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--issue.timetracking-->

If you want the time which was just logged to be added to the parent, try using the fields in the {{worklog}} smart value from the trigger. Then there would be no need to use the lookup issues action for this rule. <https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--worklog-->

The lookup issues would only be needed if you wanted to update the parent issues to a known starting point. That could use a different rule, to update each parent one time to catch-up. Then that rule could be disabled.

Kind regards,  
Bill


author: Just Me
body: Thanks a lot, Bill! This is helpful!


Tags: time-tracking
Get a total of storypoints from "Issue Lookup" action in next action
Asked by Wesley Vestjens:

We have an automation that posts a message to Slack when a Sprint starts. It works exactly as we want, however we have one small missing feature for which we're 1) unsure if it's possible at all and 2) if so, how to implement it.

We have an automation that looks like this:

* When: Sprint started (in "TEAM2")
* Then: Lookup issues (where \`sprint = {{sprint.id}}\`)
* And: Send Slack Message

In the "Send Slack Message" we have a \`lookupIssues\` template, where the url, key, summary and a custom "Refined Story Points" field is used.

After the \`lookupIssues\` template, we'd like to do two things:

* A total for the "Refined Story Points" value
* A total for the "Refined Story Points" value, but specifically those that are not in "To-do" status, e.g. stories that have been carried over from the previous Sprint.

If it's possible, some assistance in how to achieve this would be appreciated! :)


Answers:
author: Bill Sheboy
body: Hi [@Wesley Vestjens](/t5/user/viewprofilepage/user-id/5053336)

Yes, those things are possible.

I am assuming "Refined Story Points" is a custom field you have added. And so the first thing to do is to identify either the smart value or custom field id for that one. You may use this how-to article to do that: <https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/>

The total for that field would be this, substituting in your field's smart value:

```
{{lookupIssues.yourFieldSmartValue.sum|0}}
```

I added a default value of zero (0) just in case.

To get the filtered value for those not in the "To-do" status, you may use smart value, list filtering and a math expression, as referenced here: <https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588> and <https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/>

And so the filtered value would be this, substituting in your field's smart value and the exact name of the status:

{{#=}}0{{#lookupIssues}}{{#if(not(equals(status.name,"To-Do")))}}+{{*yourFieldSmartValue*\|0}}{{/}}{{/}}{{/}}

How this works, working from the inside outward:

* iterating over the lookup issues results
* filter to only include issues not in the "To-Do" status
* and add the value for your "Refined Story Points" field, with a default value of 0
* wrapping all of that with a math expression, with a default value of 0 at the front, in case no issues match the filter

A simpler way to do this would be to use a second call to lookup issues, saving both totals in created variables. But that would make your rule slower to execute.

Kind regards,  
Bill

comments: author: Wesley Vestjens
body: Wow, that's a really extensive answer! Thanks for that. It works like a charm.

Did **not** expect this to be possible! :D


author: Bill Sheboy
body: Awesome; I am glad to learn that helped :\^)
Strange error on an automation
Asked by Aaron Micallef:

Hey Guys,

Just popping this question here perhaps you had it before and have a clue why it would happen.  

Basically I created this automation here:

Trigger scheduled daily monday trough friday

than it would create a task following up with another one ( task)  
For all created issues I would than transition the workflow to another status and than would create 3 other sub-task.  

This worked without any issues until today. On the second task creation it failed which is very strange since the task created are identical and only the assignee field would be different.  

Let me know if you perhaps encountered this issue.  

Cheers Aaron![image.png](/t5/image/serverpage/image-id/295498i865D60F6F9C7D3E2/image-size/large?v=v2&px=999 "image.png")![image.png](/t5/image/serverpage/image-id/295499iEBCDFE41BBCCF85E/image-size/large?v=v2&px=999 "image.png")


Answers:
author: Bill Sheboy
body: Hi [@Aaron Micallef](/t5/user/viewprofilepage/user-id/5359754)

Does your scheduled trigger have any JQL to select issues, perhaps for use later in the rule to create the new tasks?

If not, I do not see anything obvious in your rule to cause this. The symptom seems to indicate a timing problem, such as referencing information which is not available. If you look back further in the audit log has the problem ever occurred before?

My recommendation, if you are not on a Free license, is to work with your Jira Site Admin to submit a support ticket to Atlassian for this one. They have access to logging which we customers cannot see. You can do that here: <https://support.atlassian.com/contact/#/>

Once you hear back from them, please post what you learn to benefit the entire community. Thanks!

Kind regards,  
Bill

comments: author: Aaron Micallef
body: Hello [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)

Thanks for the above info, for the time it did not happen again I guess it could have been an anomaly but if it happens again I will raise a ticket with the support for sure.

Cheers Aaron


author: Aaron Micallef
body: Forgot to mention that I did not do any changes and ran it manually successfully afterwards


Tags: cloud