I need an automation to email the last comment made on a page when status changes

Paul Rathgeb April 25, 2024

I am trying to create an automation as follows: 

  1. Status changes.
  2. Email is sent
    1. Email contains the last content posted.

 

I've tried {{comment.last.body}}, {{comment.body}}, {{issues.comment.body}}, {{issues.comment.last.body}}. Everything produces nil. How can I retrieve comments using CQL and/or Smart Values?

 

2 answers

1 accepted

0 votes
Answer accepted
Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 26, 2024

When using the status changed trigger, the smart values that are populated are:

{{page}}

{{content}}

{{space}}

{{priorContentStatus}}

https://support.atlassian.com/cloud-automation/docs/triggers-in-confluence-automation/#Page-status-changed

It would seem the only time the smart values for comments are populated is with the trigger Page commented.

 

0 votes
Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 25, 2024

Confluence would use the following for comments.

Comment properties (page and inline)

{{comment}} – Returns all available comment properties

  • {{comment.url}}

  • {{comment.id}}

  • {{comment.body}}

  • {{comment.author.fullName}}

  • {{comment.author.publicName}}

  • {{comment.author.emailAddress}}

  • {{comment.author.timeZone}}

  • {{comment.author.accoundId}}

  • {{comment.dateAdded}}

  • {{comment.dateLastEdited}}

https://support.atlassian.com/cloud-automation/docs/smart-values-in-confluence-automation/

Paul Rathgeb April 26, 2024

I used {{comment.body}} and it returns nothing at all - As if there are no comments posted. The same thing for {{comments.last.body}}.

 

Can you verify if this actually works? If so, why does it not return a value?

 

More likely, how am I misapplying the smart value?

 

Thanks

Paul Rathgeb April 26, 2024

Here's an image of the rule:

 

Screenshot 2024-04-26 081029.jpg

Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 26, 2024

What does the automation look like before you get to the email part?  Are you sure your rule is finding something that would have a comment in scope? 

I don't think you are misapplying the smartvalue, my guess is that what is being returned by the automation isn't filling out all the smartvalues you expect.

 

 

Paul Rathgeb April 26, 2024

The rest of the automation is below. The email is received. I've attached the image below, as well.

Screenshot 2024-04-26 091405.jpgScreenshot 2024-04-26 091548.jpg

 

Paul Rathgeb April 26, 2024
Hi Shawn,
After reviewing the documentation you sent via email, it seems that I can only display the most current comment when using the "Page commented" trigger. Did I understand this correctly?
Also, it only works with the structure, {{comment.body}}, and displays the comment that enacted the trigger.
This is a huge limitation, as it seems reasonable to expect the Smart Value to access (at least) the most recent comment under any circumstance.
Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 26, 2024

It would seem the only time the comment smart values are populated are when triggering off the page commented trigger. 

I tested it in my instance and can confirm they are empty when trigging off Status changed.

 

Suggest an answer

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

Atlassian Community Events