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

Can I add variables to the Summary field for current month/year by utilizing Jira automation?

Jonathan Smith November 28, 2022

I am looking to replace "The Scheduler" with Jira Automation, however the business utilizes variables in their Summary field to generate the current month and year beside the summary's text. 

Example: Publish Accrual Report monthly metrics - ${createdDate.month} ${createdDate.year}

Can variables be scripted in Jira Automation in the summary field?

Cheers!

Jonathan

1 answer

1 accepted

3 votes
Answer accepted
Darryl Lee
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 28, 2022

Hi @Jonathan Smith -

This is definitely possible.

Publish Accrual Report monthly metrics - {{now.format("MMMM yyyy")}} 

(Edited after realizing that 1) I missed a closing parenthesis, and that 2) Jonathan actually wanted the current date, not the issue creation date.)

Darryl Lee
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 28, 2022

That should return:

Publish Accrual Report monthly metrics - November 2022
If you want to abbreviate the month, you can go with "MMM yyyy"
A good reference is here:
Jonathan Smith November 28, 2022

@Darryl Lee 

Thank you for the quick feedback. I've tried inserting that code into the summary field but am getting the following error:

Create Issue

Error rendering smart-values when executing this rule:
Failed to get value for issue.created.format("MMMM yyyy": Publish Accrual Report monthly metrics - {{issue.created.format("MMMM yyyy"}}

Suggestions?

x.jpg

Darryl Lee
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 28, 2022

Ah, I missed a closing parentheses! Sorry!

{{issue.created.format("MMMM yyyy")}} 
Jonathan Smith November 28, 2022

@Darryl Lee  The rule doesn't fail or show errors, but the date information does not display after the summary. (Again, I appreciate your assistance here.. it's a learning curve.)

y.jpg

Darryl Lee
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 28, 2022

I'm an idiot. You wanted the current date, not the issue's date. That would be:

{{now.format("MMMM yyyy")}}
Like Jonathan Smith likes this
Jonathan Smith November 28, 2022

BINGO! Thank you so much!

Darryl Lee
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 28, 2022

Great! I'm going to edit my original answer so people don't need to dig through all my mistakes.

Like Jonathan Smith likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events