The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Smart values to create summary don't give expected result

Ruben
March 26, 2024

Hi,

Context: As of 1st of April July 2024 Jira will limit the amount of worklogs per item (Our worklog is above the max of 5000). We have one project which we use purely for time tracking. 

So I'm currently making a automation to create new ticket every half year. In the summary I want the following: "Worktime yyyy-Hh", with yyyy being the year and h being what half of the year.


For the summary of the newly created ticket I have the following formula:

Worktime {{now.format("yyyy")}}-H{{now.format("Q").asNumber.divide(2).ceil}}

Current date is 2024-03-26 

now.format("yyyy") => 2024

now.format("Q") => 1

now.format("Q").asNumber => 1

now.format("Q").asNumber.divide(2) => 0 (expected 0.5)

now.format("Q").asNumber.divide(2).ceil => 0 (expected 1)

 

What formula can I use to achieve this required results? 


Capture.PNG

Thanks in advance! 

Greetings,

Ruben

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Tugba Capaci
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.
March 26, 2024

Hi @Ruben ,


What are H0 and H1? Are they representing the halves of the year?

If so, you can use the following:


{{now.format("yyyy")}}-H{{#if(now.monthOfYear.lte(6))}}1{{/}}{{#if(now.monthOfYear.gt(6))}}2{{/}}



If not, could you please clarify? I'd like to assist.

For math expressions you can check out the doc here.

Tugba
actioner.com

Ruben
March 26, 2024

Hi @Tugba Capaci

Thanks, nice way to solve it! Variable h was indeed representing havles of years.

Do you get the same result when using these fomula's, just to verify. I consider them bugs and will report them if you get the same result. 

now.format("Q").asNumber.divide(2) => 0 (expected 0.5)

now.format("Q").asNumber.divide(2).ceil => 0 (expected 1)

Greetings,

Ruben

Tugba Capaci
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.
March 26, 2024

Yes, i am getting the same result. 

divide(2) and divide(2).ceil always return 0. 

Like Ruben likes this
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 Champions.
March 26, 2024

Hi @Ruben 

It appears the integer typing follows through to the end of the calculation after the earlier use of the format() function. 

Please try using the longer form of the math operations when you want to manage the typing and significant digits:

{{#=}}CEILING ( {{now.format("Q")}} / 2 ){{/}}

Or...

First create a variable with a value of 1.0 and multiply that by the formatted date's quarter before the division.  I believe this will force the typing to continue.

{{varOne.asNumber.multiply(now.format("Q").asNumber).divide(2).ceil}}

Kind regards,
Bill

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events