Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automated e-mail with Table with formatted Dates

Matheus Takeshi Yano Tako December 19, 2023

Hi Guys,

So I need a little help about a jira automation that sends e-mail.

Basically I try to create a table in a e-mail. Which I already got as the following code:

<table>
<tbody>
<table border = "1">
<tr>
<th>Nome Requisitante</th>
<th>Data Envio Recebimento</th>
<th>Nome Fornecedor</th>
<th>Serviço/Material</th>
<th>Centro de Despesa</th>
<th>Centro de Cliente</th>
<th>Empresa</th>
<th>Joker</th>
<th>PO</th>
<th>Vencimento</th>
<th>Valor</th>
<th>Nº da Nota Fiscal</th>
<th>Forma de Pagamento</th>
<th>Código de Barras Legível</th>
</tr>
{{#issues}}
<tr>
<td>{{customfield_10167}}</td>
<td>{{customfield_10168.format(“dd/MM/yyyy”)}}</td>
<td>{{customfield_10169.substringBetween("1-","2-")}}</td>
<td>{{customfield_10170.substringBetween("1-","2-")}}</td>
<td>{{customfield_10171.substringBetween("1-","2-")}}</td>
<td>{{customfield_10172.substringBetween("1-","2-")}}</td>
<td>{{customfield_10173.substringBetween("1-","2-")}}</td>
<td>{{customfield_10174.substringBetween("1-","2-")}}</td>
<td>{{customfield_10175.substringBetween("1-","2-")}}</td>
<td>{{customfield_10176.format(“dd/MM/yyyy”)}}</td>
<td>{{customfield_10177.substringBetween("1-","2-")}}</td>
<td>{{customfield_10178.substringBetween("1-","2-")}}</td>
<td>{{customfield_10179}}</td>
<td>{{customfield_10180}}</td>
</tr>
<tr>
<td>{{customfield_10167}}</td>
<td>{{customfield_10168.format(“dd/MM/yyyy”)}}</td>
<td>{{customfield_10169.substringBetween("2-","3-")}}</td>
<td>{{customfield_10170.substringBetween("2-","3-")}}</td>
<td>{{customfield_10171.substringBetween("2-","3-")}}</td>
<td>{{customfield_10172.substringBetween("2-","3-")}}</td>
<td>{{customfield_10173.substringBetween("2-","3-")}}</td>
<td>{{customfield_10174.substringBetween("2-","3-")}}</td>
<td>{{customfield_10175.substringBetween("2-","3-")}}</td>
<td>{{customfield_10176.format(“dd/MM/yyyy”)}}</td>
<td>{{customfield_10177.substringBetween("2-","3-")}}</td>
<td>{{customfield_10178.substringBetween("2-","3-")}}</td>
<td>{{customfield_10179}}</td>
<td>{{customfield_10180}}</td>
</tr>
{{/}}
</tbody>
</table>

The table is already working as the image attached. But the problem is the date fields are empty in the e-mail.
Date Format on Table in email.png

 

I don't get it why the field is empty. I've tried to create a table with only 1 row and it worked. But as soon as I change to 2 or more rows I get the field date empty.

Can someone help me with this?

 

Thanks in advance.

Best Regards.

1 answer

1 accepted

0 votes
Answer accepted
Eugenio Onofre
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 20, 2023

Hi @Matheus Takeshi Yano Tako

Have you tried replacing the smartvalue and adding the word "issue" to it? Atlassian has changed the way some smartvalues are accessed a couple years ago and requires the word ISSUE on it.

Please try something as below:
{{issue.customfield_10168.format("dd/MM/yyyy")}}

Please do not forget to accept this answer in case it helps you resolve your issue as it may help other community members in the future.

Regards,
Eugenio

Matheus Takeshi Yano Tako December 21, 2023

Hi @Eugenio Onofre 

 

I've tried applying your suggestion, but it didn't work. I got a blanked field in t Date columns.
I've seen there is a shortDate command that seems good and it worked. The problem is that, I'm from Brazil. And our date format is "dd/MM/yy".
The shortDate command gives the date as the American format which is "MM/dd/yy".
I've tried translated the Data to Portuguese (Brazil) and then use the shortDate command, but it didn't work.
If I could change the ShortDate format to Brazil's format it would work just fine for me.

I don't know if there's other way to do it. But if there is, please enlight me.

Thanks for the suggestion Eugenio.
If you got another suggestion I'll try it and show you the results.

Best Regards,
Matheus.

Eugenio Onofre
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 21, 2023

Hey @Matheus Takeshi Yano Tako

If you are an instance administrator, you can definitely change the Date Format (I understand the pain, I am also from Brazil!)

In order to change the date format in Jira Cloud, you can go to Cog icon > System > Look and feel.

Also, on Cog icon > System > General configuration > Advanced settings, you can change the format of the date picker.

Please do not forget to accept this answer in case it helps you resolve your issue as it may help other community members in the future.

Matheus Takeshi Yano Tako December 26, 2023

@Eugenio Onofre 

As we spoke before. Since I don't have permission to change that configuration, I went to our administrator to see how the date format was configured.

We saw that the configuration was already adjusted to our desired format which would be DD/MMM/YYYY.

I still can't adjust to that format to my automated e-mail.

Is there another way to configure the date format?

 

Best Regards,
Matheus.

Eugenio Onofre
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 27, 2023

Hi @Matheus Takeshi Yano Tako

Are the custom fields configured as DATE fields or as text fields?

Regards,
Eugenio

Matheus Takeshi Yano Tako December 27, 2023

Hi @Eugenio Onofre 

The custom fields are configured as DATE fields.
I assume your ideia would be to use the date fields as text fields and write the date using the brazilian format. Is that correct?
I'll test that way and comeback to give you a feedback of that suggestion.

 

Regars,

Matheus.

Matheus Takeshi Yano Tako January 10, 2024

Hi @Eugenio Onofre 

Just to update you. I've tried your suggestion to use the date field as a text field and write the dates in the Brazillian Format. It worked fine as the image below:
Date Format on Table in email - Worked.png
Thanks for helping me with such a bright and simple ideia.

Finally it's gonna be fully automated.

 

Best Regards,

Matheus.

Eugenio Onofre
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2024

This is great to hear!

Please remember to accept this answer in case it helps you resolve your query so it can also help other community members in the future.

Regards,
Eugenio

Suggest an answer

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

Atlassian Community Events