How to convert interval to millis in SIL

I just need to provide the results in weeks only, so it is the opposite of millisToInterval(millis).

I need IntervalToMillis :)

3 answers

1 accepted

0 votes
Accepted answer

Hi,

I have answered here, http://bugs.kepler-rominfo.com/browse/KCF-18, I will write it here too:

You can get the interval as milliseconds by casting an interval to a number, like this:

interval i = "2h";

number n = (number)i; // holds 7.200.000

Usually, you will divide this number to 1000 * 3600 * 8 * 5 to get the number of weeks. Assuming 5 days / week, 8 h / day. We also have a round routine to pretty print the number, if necessary: http://confluence.kepler-rominfo.com/display/JJUP20/round. The rest is up to you, you are free to do whatever you want with the number of weeks :)

Best Regards,

Silviu

Silviu, thanks! It works and I was able to get the week on the field n.

The problem I am having now is that JIRA is not interpreting the results as "number" so it is not ordering the column in descending order or grouping issues when I want to use the two dimensional gadget.

Do I need to convert n to any other format to be able to do that? I rounded the results to 0 so I can see just the Weeks.... but the whole purpose of this was to group all the issues by the number of weeks.

Two dimenssional gadget interprets the result as None and pie chart as 0.0, so I am assuming that the issue is with the format ??

Thanks!

reindexing now to see if this fix the issue. Per Radu, Indexing is very important. If you want it number, you should select the correct indexer.http://confluence.kepler-rominfo.com/display/KCF/SIL+Script+Custom+Field

I am hopping to get a number as result and then convert it to Weeks

I want to show the remaining estimate and original estimate in hours only. How do I do that?

Check my answer, you will have to divide by 1000 * 3600.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published yesterday in Agile

Try the new Jira Cloud add-on for Google Sheets

Hi Atlassian community, I work on the product integration team at Atlassian and I am very excited to announce the early access program for the Jira Cloud add-on for Google Sheets. This add-on giv...

155 views 1 7
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you