Put task due date in email

Derek F November 30, 2022

With Jira automation, I have a daily scheduled task that will email the assignee, for each task that is due tomorrow ("Due Date[Date]" = 1d).

 

What I am trying to do is to put in the subject line the issue key and due date. It's supposed to work with {{issue.key}} is due on {{issue.duedate}}.  The issue.key works, but the issue.duedate is blank.  I have guessed at the syntax for the due date about twenty different ways and it always comes up blank.  I have tried {{issue.fields.Due Date}} and {{issue.Due Date}} and other variations without spaces and changing up the capitalization.

 

Thanks for any help.

 

2 answers

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2022

Hello @Derek F 

Welcome to the community.

Are the issues in a Company Managed project or a Team Managed project?

Can you show us the full details of the automation rule? What type of action are you using to get the issues that are due?

Bill Sheboy
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 Leaders.
November 30, 2022

Hi @Derek F -- Welcome to the Atlassian Community!

Adding to Trudy's answer...

Smart values are name, spacing, and case-sensitive.  To confirm you have the correct smart value for a field, please use this how-to: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Essentially you find an example issue with your field, and call the REST API for the issue with a browser.  That will show all possible fields supported by rules, and their respective smart values and custom field ids.

Kind regards,
Bill

Derek F November 30, 2022

@Trudy Claspill : I'm not sure what the difference is between Company Managed and Team Managed, but I'm not a JIRA admin and I'm working within my team's project.  So maybe the latter?

 

@Bill Sheboy : Thanks for the tip, I used the REST API and discovered:

"customfield_11500":"Due Date"

and

"customfield_11500":"2022-12-01"

With that info, I tried:

{{issue.key}} is due on {{issue.fields.customfield_11500}} which WORKED but it's kind of ugly

{{issue.key}} is due on {{Due Date.value}} returned nothing.  Which is strange because the doc page says in the example at the bottom:

You can reference this field in a smart value using {{customfield_10034.value}}. To make this smart value easier to read, you can also substitute customfield_10034 for the field’s name: {{Cascade List.value}}.

 

It may or not be relevant but there are two due date fields in JIRA and I can't remove one for the other as they are available and used Company-wide.  One is "duedate" which I believe is the one that comes out of the box. In REST this is showing as null.  "Due Date" is the one used in my project.

Bill Sheboy
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 Leaders.
November 30, 2022

Yup, "Due Date" is one of the messier smart values. 

I have seen multiple things work for that field in rules, and so checking with that how-to  article can help when in doubt.

And also...sometimes quotation marks are required when a field's smart value contains non-alphanumeric characters, such as {{issue."My custom field"}} versus {{issue.My custom field}}  The work-around is to use the customfield id number.

And...if you are seeing multiple "Due date" fields at a site level (for company-managed projects) an admin has added a duplicate and that might cause a problem in rules/field configurations to get at the value.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2022

Hello @Derek F 

When you are viewing your project, at the bottom of the navigation pane on the left it should say the project is either company-managed or team-managed.

Screen Shot 2022-11-30 at 2.49.29 PM.png

Derek F December 1, 2022

It is a company-managed project.

I asked the admin to delete the other due date field yesterday which they did.  Hopefully that helps in the future.

I can live with the custom field id if specifying the words "due date" doesn't work out, I just think it will be confusing if anyone comes along after me and tries to work on the automation.  NBD

@Bill Sheboy I tried several "Due Date" syntaxes and they were all blank.

@John Funk  see below

jiraemail.PNG

Bill Sheboy
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 Leaders.
December 1, 2022

Hi @Derek F 

I just did a quick test in a Company-managed Project, and here were my results:

Capture.PNG

 

That last one has stopped working in rules but I believe still works in JQL and the REST API.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 1, 2022

Still makes no sense that the code I have above in my answer does not work for you. 

Like Bill Sheboy likes this
Derek F December 2, 2022

I have asked the JIRA experts / admins to take a look at this and they will today.  I want to mark the correct comment as the answer when I know what it is

Like John Funk likes this
Derek F December 8, 2022

I still don't have the correct syntax figured out to use "due date" english in some permutation even with my org's expert help, however, the customfield actually solved my original issue so I am marking this as the correct answer thread

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2022

Hi Derek - Welcome to the Atlassian Community!

I used this with success for the subject:

{{issue.key}} is due on {{issue.duedate.longDate}}

Derek F November 30, 2022

Also blank :(

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2022

You have another issue then, because that worked perfectly for me. 

Can you share a screenshot of your rule that shows the details of the email? 

Suggest an answer

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

Atlassian Community Events