Forums

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

Setting Quarter and Year in Summary Using Smart Values & Automation

Amelia Giuliani
Contributor
December 18, 2025

Hi Everyone! 

I had what I thought was a simple problem - A team that has quarterly tasks that they wanted the work item(issue) summary to state last quarter and year when created to make searching easier and clearer when items get left open and when looking for historical data. (example: Task A Q4 2025 would be created January 1 2026)

We automate tasks using the schedule option every 3 months (the first day of the next quarter) 

However, I learned that jira automation can't use If Else statements AND Jira doesn't recognize .quarter AND the summary field has a text limit of 255 characters and it counts your smart statements not the output of said smart statements. 

Here is the formula I made that works: 

Q{{#if(now.minusMonths(3).monthOfYear.lte(3))}}1{{/}}{{#if(now.minusMonths(3).monthOfYear.lte(6))}}2{{/}}{{#if(now.minusMonths(3).monthOfYear.lte(9))}}3{{/}}{{#if(now.minusMonths(3).monthOfYear.gte(10))}}4{{/}} {{now.minusMonths(3).year}}

Now I know what you are thinking... if you had month 5 it would in theory display Q12 but for some reason it doesn't. I'm going with it. 🫠

I ran into a couple tasks that have longer titles (around 20 characters not a lot) and I can't get them shortened anymore without them starting to resemble a cat crossing my keyboard rather than something I intentionally typed that makes sense. 

Anyone have any ideas of a better solution for this or cleaner code? 

 

2 answers

4 votes
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 Champions.
December 18, 2025

Hi @Amelia Giuliani 

I recommend using date formatting to get the quarter and year.  For example:

{{issue.duedate.format("qqq YYYY")}}

Please note well: the YYYY format is for the calendar year versus yyyy for a week-based year, so please adjust based upon the year-formatting you want.

For your scenario, you could increment the date before getting the format.  This is the same one would do when using fiscal quarters, where they are shifted by a number of months.

 

To learn more about date formatting, please see the additional details under the format() function documentation:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-format---

 

Kind regards,
Bill

John Funk
Community Champion
December 18, 2025

And just to add to Bill's answer with some clarification - automation rules CAN do IF/ELSE. And Jira does recognize quarters as shown in Bill's answer. And you could create a variable with your formula and then use the variable identifier in the summary field get potentially get around the limit. 

0 votes
Rik de Valk _Brainboss_
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 Champions.
December 19, 2025

Hi @Amelia Giuliani

I got to admit: I love these type of puzzles 😄. There are probably more elegant solutions to this. But this is how I would approach this: 

  1. Create a variable for 'lastQuarter'
    This would take now() as the starting point and fetch its monthOfYear. Then divide it by 3 months and take the 'floor'. That will give you the current Quarter. Then subtract 1 from that to get the previous month. This can result in a '0', but we'll correct for that later. 
    {{now().monthOfYear.divide(3).floor().minus(1)}}
  2. Create a variable for 'year'. But if the above lastQuarter is 0, subtract 1 from the year (because if previous quarter is Q4, we're also in last year) 
    {{if(equals(lastQuarter, "0"), now().format("YYYY").asNumber.minus(1), now().format("YYYY").asNumber)}}
  3. Then correct the lastQuarter in case it is '0'. You do this by creating a variable, but with the same name 'lastQuarter'
    {{if(equals(lastQuarter, "0"), 4, lastQuarter)}}
  4. Create a variable for 'prefix'
    {{year}}Q{{lastQuarter}}
  5. Add the prefix to the summary. Use the Edit Work Item action and set the summary to
    {{prefix}} | {{issue.summary}}

     

Hope that helps. Happy holidays!

Rik 

Suggest an answer

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

Atlassian Community Events