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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Use math expression in date smart value to set due date

Edited

Hello,

i have to set a due date with an automation for jira automation on jira datacenter. The due date should be the last day of the current quarter and i thought i could do something like this:

{{now.withmonthOfYear({{now.format("Q").multiply(3)}}).endOfMonth}} or

{{now.withmonthOfYear({{#=}}{{now.format("Q")}} * 3{{/}}).endOfMonth}}

but its not working. Is there a way to achieve this?

 

the .multiply thing doesnt seem to do anything at all, but the expression

{{now.format("Q")}} * 3{{/}}

does give back the numer 3 i would need, but if i use that in the due date field i cant even save the automation.

2 answers

@Bill SheboyHello,

the datacenter version doesnt have the variable functionality. I was able to save the rule with the asNumber part, but it again didnt work. The due date fields just stays empty. I was able to do it with a scriptrunner script...but it feels like overkill :(

0 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 Leaders.
Mar 10, 2022

Hi @systems-intern 

You might need to convert the result of the format() operation to a number for the math to work, or store it in a created variable and then use it.  To do it the first way, please try:

{{now.withMonthOfYear(now.format("Q").asNumber.multiply(3)).endOfMonth.jiraDate}}

Kind regards,
Bill

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 Leaders.
Mar 11, 2022

Hi @systems-intern 

Please try to keep your responses to one thread of conversation.  That will help others see if there are multiple approaches to solve the problem.  Thanks!

And thanks for noting you are using the Server/Datacenter version.  Please try to include that information when posting questions as the different Jira versions have different behaviors.

The smart value expression I provided will return the correct value.  To use that to set the Due Date field try removing the last part which specifies the data format:

{{now.withMonthOfYear(now.format("Q").asNumber.multiply(3)).endOfMonth}}

 

If that still does not help, please post images of your complete automation rule and of the audit log details showing an execution of the rule which does not work.  Those images may provide more context for what is happening.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events