Forums

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

Send e-mail with comments added after certain date via Automation

Dominik Kaźmierski
Contributor
March 8, 2026

Hello Atlassian Community!
I want to create Automation which sends e-mail to certain user with all the comments from the work item added after the date saved in custom field.

I created date-time customfield_11982, which is currently Mar 08, 2026, 8:55 PM (2026-03-08T19:55:19.4+0000).

Five comments were added after this date and time but no comment is sent by e-mail.

My current smart values in automation looks like this:

{{#issue.comments.reverse}}
{{^author.displayName.equals("Automation for Jira")}}
{{#if(created.jiraDateTime.isAfter(issue.customfield_11982.jiraDateTime))}}
[{{author.displayName}} ({{author.emailAddress}}) - {{created.format("dd-MM-yyyy HH:mm")}}]:
{{body}}
-----------
{{/}}
{{/}}

It works properly when instead of "issue.customfield_11982.jiraDateTime" there is for example now.minusHours(4).

1 answer

0 votes
Arkadiusz Wroblewski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
March 8, 2026

Hello @Dominik Kaźmierski 

I think the problem is here: issue.customfield_11982.jiraDateTime

isAfter() compares date objects, but .jiraDateTime formats the value as text. That would also explain why now.minusHours(4) works, because that is still a real date value. Atlassian’s smart value docs show isAfter() being used directly with date fields, not with formatted text.

Dominik Kaźmierski
Contributor
March 9, 2026

Hi !
Thank You for your answer.

Do You have any ideas how to compare those two values then?
I tried using created.gte(issue.customfield_11982), created.jiraDateTime.gte(issue.customfield_11982.jiraDateTime) and created.toDate.isAfter(issue.customfield_11982.toDate) - it doesn't work as well.

Arkadiusz Wroblewski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
March 9, 2026

@Dominik Kaźmierski 

yes, I would try it without .jiraDateTime.

So I would test:

{{#issue.comments.reverse}}
{{^author.displayName.equals("Automation for Jira")}}
{{#if(created.isAfter(issue.customfield_11982))}}
[{{author.displayName}} ({{author.emailAddress}}) - {{created.format("dd-MM-yyyy HH:mm")}}]:
{{body}}
-----------
{{/}}
{{/}}
{{/}}

If that still does not work, I would add a Log action first and print both values, just to verify the field is really available in the rule in date format.

Dominik Kaźmierski
Contributor
March 9, 2026

Hi!

I tried {{#if(created.isAfter(issue.customfield_11982))}} already and it doesn't work.

I also added Log actions and it seems that fields are available as date formats:
Zrzut ekranu 2026-03-09 140900.png

 

But it seems not to work in "send e-mail action" while iterating through all the comments (deleted {{^author.displayName.equals("Automation for Jira")}} for now, just to be sure, that it doesn't interfere with the rest).
Zrzut ekranu 2026-03-09 141154.png

Arkadiusz Wroblewski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
March 9, 2026

@Dominik Kaźmierski 

Please paste Screenshot from entire Automation.

Suggest an answer

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

Atlassian Community Events