Forums

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

Is there a way to insert the current date into a field edited by an Automation for JIRA rule?

Blake Pusztai
Contributor
December 4, 2018

Hello,

I'm using Automation for JIRA to create rules that will auto-cut new dependent-linked issues from one ticket in into other projects to engage their related workflows.

Is there a way to insert the current date into the summary of the created issues?

This will add visual disambiguation in the event multiple issues are cut to the same destination project from the same source issue with identical titles. I noticed that "currentDate()" doesn't work in JIRA like it does in Confluence. Here's the "Summary" text I have tried:

{{triggerIssue.key}} | currentDate() | {{triggerIssue.summary}} 

Thanks!

2 answers

1 accepted

3 votes
Answer accepted
Blake Pusztai
Contributor
December 4, 2018

Found the answer: https://docs.automationforjira.com/working-with-issue-data/date-functions.html#formatting-dates

Doing it this way works:

{{triggerIssue.key}} | {{#now}}shortDateTime{{/}} | {{triggerIssue.summary}} 

I swear I Googled a few things before posting. :) Anyway, thanks!

0 votes
Cristian Rosas [Tecnofor]
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 4, 2018

currentDate() is probably a kinf of data which won't work in a string field like summary. Try something like

 now().toString()

or

currentDate().toString()
Blake Pusztai
Contributor
December 4, 2018

Thanks for the quick reply! Is there a way to format that date value, such as MM/dd?

Blake Pusztai
Contributor
December 4, 2018

Hi @Cristian Rosas [Tecnofor]. I just finished testing, and unfortunately neither of those options work. now() and currentDate aren't substituted with their actual date valuees.

Here's the "Create issue" action I'm using, and everything works, except the Summary value of the created tickets looks like:

TEST-1 | currentDate().toString() | Test UTEST project story

Or

TEST-1 | now().toString() | Test UTEST project story

Any other suggestions?

CreateIssure_Test_20181204.png

Suggest an answer

Log in or Sign up to answer