Is it possible to use smart values in Summary field when creating issues with Jira Automation?

janez_m January 11, 2021

I love the Jira Automation plugin, but it seems I am unable to use the smart values for the month description on the Summary field?

We have recurring tasks and I want to insert the name of the current month into the Summary, but whatever I tried with smart values, it was not satisfactory.

I've tried:

{code}

{{monthOfYear}}

{{now.monthOfYear}}

{{now.startOfMonth}}

{{now}}

{/code}

The best I've got are only numbers, like 1 for January, or the whole date-string for now, but I would need a descriptive name, like January, not just the number 1. I suppose it is possible to do this only with custom smart values? How would you do this?

 

 

 

4 answers

1 accepted

1 vote
Answer accepted
Gareth Cantrell
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.
January 11, 2021

Hi,

You can use the .format(<date pattern>) smart function to achieve this.

This function uses the underlying Java data/time formatting patterns (available here).

For your specific scenario, you can use the following smart value:

{{now.format("MMMM")}}
janez_m January 11, 2021

Thank you Gareth, this format works perfectly.

And thank you for the Java formatting patterns!

 

Have a great day!

Like # people like this
0 votes
Mohamed Benziane
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, 2021

Hi @janez_m 

 

You can use this it should works fine (it will return "January" in this case) :

{{now.format("LLLL")}}

https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html

 

Hope this helps 

janez_m January 11, 2021

Thank you Mohamed, I've tried the "LLLL" but it only prints "1", but Gareth pointed out I can use the "MMMM" option and it works perfectly.

 

Thank you also for the java hint for date formatting.

 

Have a great day!

0 votes
janez_m January 11, 2021

I found out that there are other possibilities of formatting the date, but just two to write the whole name of the month with other date data, but none just for the month..

now.format("MM/yyyy")
01/2021

now.longDate
January 11, 2021

now.mediumDate
Jan 11, 2021

now.fullDateTime
Monday, January 11, 2021 2:42:33 PM GMT

 

From: https://confluence.atlassian.com/automation/date-and-time-functions-993924864.html

0 votes

Hello.

I had a very similar issue in the past. I had a workaround using a postfunction which was able to modify the summery. 

  1. Create the issue with Automation
  2. Add a postfunction in the workflow at the 'Create' transaction to modify the summary to your needs.
    1. Don't forget to filter out the tickets not created by the automation!
  3. Enjoy.

Best: Peter

Suggest an answer

Log in or Sign up to answer