SIL Script and Interval custom fields

The interval custom fields work great for trying to track some additional estimates and work done on a particular item(yes, I'm trying to avoid sub-tasks). I'm also trying to use a SIL script to calculate work left(Estimate - Work Done). When doing so, it's treating the interval value as a 24 hour intervals(instead of 8 hours a work day). Even just returning the custom field value in the SIL script shows this.

1 day in the interval field shows as 8 hours in the SIL field.

2 days in the interval field shows as 16 hours in the SIL field.

3 days in the interval field shows as 1 day in the SIL field.

Is there something I can do in my script to make sure these show up correctly(3 days shows as 3 days)?



2 answers

1 accepted

1 vote
Answer accepted

Hi Casey,

Internal and external representation of a value are different things. You are substracting est - wd, but you are showing it in a 'non-interpretative' field (kcf). I'm on holiday (so I do not have something to test on) but you should multiply the value acordingly.

I will add an improvement to create a routine to format intervals; we'll take care of it in January.

Thanks Radu. That makes sense.

It's not limited to the result of the est - wd, but even if I just output the value contained in the custom field directly. So if I enter 3d as the estimate, it shows as 1d in the 'non-interpretative' field.

A simple multiplier doesn't seem to be sufficient. I can make the day cases work correctly with a multipler of 3(est matches 'ni' field), but then this breaks the hour cases. And then that doesn't carry across to the weeks either(2w becomes 1w 3d, which is the correct number of days, just not counting weekends and the like). Is there a raw value I could access and use?

It's easy enough to work around by not using an interval field and just tracking it as a number of hours... Then I can easily use the calculated field.

I'll try whatever you come up with. Enjoy the rest of your holiday!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


270 views 0 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