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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,392
Community Members
 
Community Events
184
Community Groups

how to convert original estimate to number

I have a formula that i must multiply a custom field number by the original estimate , i find problem because the original estimate have not the number type 

 

so i need to convert it.

 

Regards

 

2 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 28, 2018

The original estimate is not a "duration", it's a number.  Measured in milliseconds, so if you want it in minutes, you need to convert it with

issue.getOriginalEstimate() / 60,000

For hours, divide again by 60.  For days/weeks though, again divide, but remember to take into account your time tracking settings (1 day is 8 hours, not 24)

Note - that call above should return a long number if I remember right, but I think it's ok to multiply a long with a double?

Hi, how to do the opposite of that calculation ? 

I suppose that i have a number, and i want to put it in the original estimate field 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 12, 2020

How are you putting it in?  Code?  Typing?  REST call?

using the smart values

{{#math}}{{issue.customField_10061}}+{{issue.customField_10062}}+{{issue.customField_10063}}+{{issue.customField_10079}}{{/math}}

 

it works when the sum is an integer, but doesnt when it's real 

ex : 1 + 1 + 3 + 2   shows "1d" in the original estimate 

or 1.5 + 1.5 + 2 + 1 shows 6h 

but when i put 1.5 + 1 + 2 + 3 the rule doesnt execute 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 12, 2020

I don't use smart values, but that looks like a bug in it.

I tried to use JSON,

here is my script 

{
"fields": {
"timetracking": {
"originalEstimate": "issue.customField_10087"

}
}
}

 

where the customfield 10087 is a text field and i've entered as an example : "1h 30m" , but still doesnt work :s 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 15, 2020

Could you enter it in milliseconds, as that's the storage format?

4.5 gives me this result when i do the conversion to milis 

image.png

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 16, 2020

Ah, the API is not listening in milliseconds.  Have you tried plain 4.5?

What do you mean by plain 4.5 ?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 16, 2020

Literally feed it a number.  The rest API only takes numeric data (I thought it was milliseconds because that's what I see in code elsewhere).  4.5 is likely to be 4.5 hours, but you'll see that when you look again at the issue.  Whatever unit it is expecting, it will be consistent.

when i add 0.5 to 4.5, it's working and showing 5hours, also if i add 2.5 to 4.5 it shows 1d (as i've set 1day=7hours in the Timetracking settings). 

However, i want to have the 4.5 or whateaver (1.75 hours ...etc.) . But it's frustrating because it's not working! 

Is it a bug ??? do i have to report it ? 

Thank you again for you answers, fixing this problem will have an impact in our Jira projects. 

Like Luis Alejandro De Peña likes this
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 16, 2020

Are you saying decimal values are not working?

Yes exactly. 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 16, 2020

That is very odd, it works for me.

I think, yes, you may need to report it as a bug.

Could you send me a screenshot of how did you manage to make it works ???

Thank you 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 16, 2020

I'm not doing anything differently to you.  Hitting the rest endpoint with a curl backed json payload.

I'm i doing something wrong in this code ??? 

 

{
"fields": {
"timetracking": {
"originalEstimate": "issue.customField_10061+issue.customField_10062+issue.customField_10063+issue.customField_10079"

}
}
}

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 16, 2020

Yes, you need to give it a number, not a string of custom field names.

could you please give me an example ? 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 17, 2020

{
"fields": {
"timetracking": {
"originalEstimate": "4.5"}
}
}

Works for me.

Me too,  but is there a way To parse the value of a cutom field.  ???

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 17, 2020

Yes, your code will need to ask Jira for the data for the fields, do the calculations you need and then send back a number.

Ok, i'll try this, but do you have any documentation ? i'm not very familiar with JSON in JIRA, just starting. 

Hello Assia,

can you solve this issues?

i need this feature and don't know how to configure it.

can you help me if resolved it?

 

thank's

Azadeh

I'm having the same issue ,,,, any help in this regard? When my custom field has a value of 4.5 it calculates as 45h! (number field and I pass the value as smart value with "h").

you may want to try 4,5

Is there any solution to the problem described above that entering 4.5 leads to 45h yet? 
I am having the same issue when populating the field via Jira Automation with the following formula: 

{{#=}}{{triggerissue.timeoriginalestimate}} * 0.85 / 3600 {{/}}

With the input parameter is 10h, I would expect to see 8.5h - what we get is 85h - when changing the 0.85 to a one digit decimal like 0.8 or 0.9 it gives me 8h, 9h respectively. 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 21, 2023

It's the same as given before.

Can you Give Some Example cant able to understand properly

@Rajesh Ramankutty 

my formula is 

 

result = Original estimation * double(avp) 

original estimation type is duration 

avp is a custom field with type double.

 

Regards

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events