[Confluence Automation] How to get a page URL or ID of the incomplete task?

Helen Rastetska November 13, 2023

I am trying to automate the notification about incomplete tasks assigned to the person. In the scope of this notification, I want to mention the Confluence page where the particular incomplete task is located.

Does anybody know if that is possible using current Confluence Automation tools or is it planned for future releases?

 

Thanks in advance,

Helen

1 answer

1 accepted

0 votes
Answer accepted
Trev Angle
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 13, 2023

You should be able to use smart values for this! See our documentation on smart values here: https://support.atlassian.com/cloud-automation/docs/smart-values-in-confluence-automation/

 

Note that the smart values may differ depending on which components you are using in the rule. If you are using the task-related triggers, all the {{page}} and {{task}} smart values should be available. If you are using the task branch with something like a scheduled trigger, then only the {{task}} smart value will be available by default.

 

edit: Jump to the comment with the rule structure that fully addresses this use case https://community.atlassian.com/t5/Confluence-questions/Re-Re-Confluence-Automation-How-to-get-a-page-URL-or/qaq-p/2691616/comment-id/312607#M312607

Helen Rastetska November 15, 2023

Hi @Trev Angle ,

I am using a task branch - for all incomplete tasks I am sending the notification. So I need to:

1) Know the page URL or ID where the incomplete task is located

2) Check that this page is located in the specific section and send a notification if that's the case

 

I couldn't find any smart value that could resolve my issue. That is why I'm asking the community. Probably this is something Atlassian should enhance in future releases.

 

Thanks,

Helen

Trev Angle
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 29, 2024

Sorry for replying so late, but I'm happy to say that the task branch now outputs the {{page}} smart value for whichever page the task is on! I think that will address your issue.

See more in this community post: https://community.atlassian.com/t5/Confluence-articles/MANY-New-Smart-Values-Added-to-Automation-for-Confluence/ba-p/2588511 

Helen Rastetska April 3, 2024

Hi @Trev Angle ,

Thanks for the update.

With the new outputs of the task branch, it does resolve my point #1 now, however, the second one remains outstanding - "2. Check that this page is located in the specific section and send a notification if that's the case".

 

So my goal is to collect all uncompleted tasks from only those pages that are located under specific pages (e.g. collect incomplete action points from all Retro pages).

Inside the Task branch, I tried to add various conditions none of which are working. Here are some examples I tried (xxx, qqq, www and eee below are just the ids of the pages):

CQL condition: ancestor = xxx

CQL condition: {{page.parent.id}} IN (qqq, www, eee)

CQL condition: {{page.parent.id}} IN ("qqq", "www", "eee")

CQL condition: {{page.parent}} IN (qqq, www, eee)

CQL condition: {{page.parent.id}} = qqq OR {{page.parent.id}} = www OR {{page.parent.id}} = eee

CQL condition: {{page.parent.id}} equals qqq OR {{page.parent.id}} equals www OR {{page.parent.id}} equals eee

e.g. 

2024-04-03_14-47.jpg

In the case of an ancestor, it doesn't return anything at all. In all other cases, the rule breaks with an error that is hard to understand:

2024-04-03_14-42.jpg

Could you please advise if there is a plan to support more comprehensive syntax in the Task branch in future?

 

Thanks,

Helen

Trev Angle
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2024

Unfortunately the CQL condition doesn't work to filter results from the task branch, you have to use the smart value condition. I would try using the {{page.parent.id}} smart value in that condition to filter the tasks. You can put multiple conditions in a row to check for multiple parent pages.

edit: using two conditions in a row like this doesn't actually work, please see the rest of this thread to see some rule structures that will work

Screenshot 2024-04-12 at 3.05.06 PM.png

Helen Rastetska April 23, 2024

Hi Trev,

 

Sadly this approach doesn't work for me. It just does nothing - not even adding a value to the audit log for the page parent, as well as not sending a Teams message. 

2024-04-23_11-40.jpg

2024-04-23_11-43.jpg

This is all I get in the Audit log:

2024-04-23_11-45.jpg

 

I appreciate any help and will be happy if the Atlassian team adds similar branch rules and conditions that we have in Jira. That will simplify life a lot!

 

Thanks,

Helen

Trev Angle
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2024

Oops that rule structure I recommended is flawed. The page would need to have two different parents to make it through both conditions, which doesn't make sense.

Here's a new rule structure which should work because I actually tested it this time (sorry!)

Screenshot 2024-04-30 at 1.55.12 PM.png

 

I would recommend copying and pasting this into your smart value condition and then only changing the numbers to match the parent IDs you want (make sure you don't leave out the quotation marks!):

{{or(page.parent.id.equals("1540097"), page.parent.id.equals("327868"))}}

 

Here's the documentation for the or() function with smart values: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#or

 

And the documentation for the .equals() function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#equals-string-

Helen Rastetska May 7, 2024

Hello Trev,

Thank you for bringing a new idea! I tried this approach as well. Unfortunately, there was no luck. The rule just doesn't go beyond the IF condition.

 

2024-05-07_11-15.jpg

2024-05-07_11-17.jpg

From the screenshot above it's clear that there is no second Audit Log comment that had to be added after passing the IF condition, so I assume the root cause is still there.

Will appreciate any help or advice!

 

Thanks,

Helen

 

Trev Angle
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 2024

Hm I think it's because the or() function only works if you pass in two values. We could try composing several or() functions but I think that's overkill.

Regular expressions will probably be the easiest approach. I just tested it and it should work the same as before, except you can have more than two parent pages. The rule will have the same basic structure and just the comparison condition needs to change.

In the first field, put the smart value {{page.parent.id}}

For the condition, pick exactly matches regular expression

In the second field, copy and paste the regular expression (1540097|327868|123456|56789) and replace the numbers with the parent IDs you want. If you need more IDs, just be sure to separate each number with a pipe symbol |

Screenshot 2024-05-07 at 6.02.16 PM.png

 

Let me know if that works for you!

Helen Rastetska May 8, 2024

Hi Trev,

 

This solution works perfectly! Thank you a lot for your effort in helping me resolve my issue! 

 

Best wishes,

Helen

Like Trev Angle likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events