Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to send batched email for incomplete past due tasks to email addresses based on page id

Paul Rathgeb November 4, 2024

I have an automation that collects past due incomplete tasks by Assignee, verifies there are such items, and then sends batched notification emails to Assignees. I want to add a component that sends the email to specific individuals based upon the parent.id of the page containing the task.

I have tried a variety of methods, but all result in "No Actions Taken." Here are the automation steps of one attempt:

1. Trigger = Scheduled.

2. Task Branch = Status is "incomplete", AND Due date has passed by 1 days.

3. Advanced branching = Smart value is {{tasksPerAssignee}}, Variable name is "TestAgain".

  • IF (Compare two values) = First value is {{TestAgain.first().assignee.emailAddress}}; Condition is "does not equal", Second value is "Empty".
  • And (Compare two values) = First value is {{page.parent.parent.id}}; Condition is "equals", Second value is "327815189".
  • Then Send email: To is {{desired@emailaddress.com}}, Subject is "Test", Content is {{#TestAgain}}{{body}} {{/}}

The automation works without the "And" bullet, but not when it's added. Any help is appreciated! This is true for any configuration I've tried when the "And" bullet is included.

 

2 answers

0 votes
Michelle Smith May 4, 2025

Thanks Paul,

The second example got me closer :)  It's not particularly practical to be hardcoding pageids in, but having the hyperlink to the page is a help.    

It would be nice if we could somehow "order" the listing of tasks by the page they exist on - then at least the tasks would be crudely "grouped" by page.

My use-case is mainly to identify tasks that have been unassigned.   We flag "things to be done" without assigning them to a specific person until later in the process.   Many times the person who owns the page is the owner of the tasks by default, so assigning them to that person is a bit redundant for us.

This is a help though, thank you :) 

Paul Rathgeb May 5, 2025

You could always put a Condition that looks for a blank (that is "") NAME. 

 

Glad to have helped a bit!

Michelle Smith May 5, 2025

agreed, finding unassigned tasks is easy - the TaskPerAssignee will return them with a condition "Assignee is equal to Empty".    But I can't find a way of determining who owns/authored the page that the task resides on.   The task entity gives us contentId....but I don't think the {{}} allows us to then retrieve the "page" object that contentId represents so that we can get the email address of the person who originally created / last authored / is current owner of the page.

Ideally I think I want a TaskPerPage collection - then i could iterate through each page, instead of each assignee.

But what I've got now is a step in the right direction :) 

Paul Rathgeb May 6, 2025

I may be missing the problem, but have you tried something like this?

  • If task is unassigned, then send an email to {{page.author.emailAddress}}.
0 votes
Michelle Smith May 1, 2025

I'm trying to do a similar thing - did you ever get this working!!?

Paul Rathgeb May 2, 2025

Yes. I used the Action Item macro on the page to add a tick box to the page.

Screenshot 2025-05-02 061837.jpg

Screenshot 2025-05-02 062027.jpg

Notice that, immediately after my tick box, there is A) the title, B) /date, and C) @Name. The macro associates these values with that check box in front of them.

For your Automation:

The first automation sends an email to notify when a single individual completes any of a set of tasks.

Trigger: "Task status changed" to Complete.

     This triggers the automation to run when a tick box is checked.

1) Nested If: Using the "If-else If' form,..

     Condition 1: {{smart values}} condition

     First value: {{page.parent.id}}

     Condition: equals

     Second value: 12345678

          second value is page ID.

     All conditions match: AND

     Condition 2: Page Condition

     Where: Title contains

     Condition: equals

     Tick box Title

          The title you gave the tick box on your page.

     A) If Block: 

          Condition 1:

          First value = {{task.body}}

          Condition = contains regular expression

          Regular expression = (Title)

               Enter the title of your tick mark in parentheses.

          At least one condition matches: OR

          Conditon 2:

          Enter as many conditions WITHIN this If block as you wish.

     B) Then: Send email: Email message content

          {{task.assignee.fullName}} has been set to complete.

          <b>{{task.body}}</b>{{page.url}}

2) Else If: Enter another Page with its Tick Boxes following the same structure.

 


This second automation sends an email that includes all past due tasks for a specific task owner as assigned on your page.

Screenshot 2025-05-02 072443.jpg

 

Trigger: Scheduled: set your trigger date/time/frequency.

1) First branch: Task Branch

     Where: Status is incomplete

     And: Due date has past by X days.

2) Second Branch

     A) Advanced Branching

         Smart value = {{TasksPerAssignee}}

         Variable name = TasksPastDue

     B) If: Compare two values

          Condition:

          First value: {{TasksPastDue.first().assignee.fullName}}

          Condition: equals

          Second Value: Name of Task Owner

               The "Name of Task Owner" is the exact Confluence name of the person you assigned the task to on your page using the @Name macro.

     C) And: Compare two values

          Condition:

          First value: {{TasksPastDue.contentid.first()}}

          Condition: contains regular expression

          Regular expression: (First page id under consideration | Secoond page id under consideration | ...)

               In parentheses, list the page IDs for every page with tick boxes owned by the task owner separated by the pipe symbol, e.g. (12345678|12345679|12345680)

     D) Then: Send email: Email message content

          {{TasksPastDue.assignee.first().fullName}} is past due on the following tasks.

          {{#TasksPastDue}}{{body)/}}

 

          If you want to get fancy, you can include a link to the page as follows:

          [base url of your company's confluence page]/{{contentId}} it will look something like this:

          {{#TasksPastDue}}{{body}}<br/>https://company.atlassian.net/wiki/spaces/KT/pages/{{contentId}}<br/><br/>{{/}}


I hope this helps!

Suggest an answer

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

Atlassian Community Events