Forums

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

Jira Misc Calculated Number Field Formula help

David Thompson October 1, 2014

Hi,

I have a working formula in a Calculated Number Field custom field that calculates the minutes between a date and time field and the current date and time.

<!-- @@Formula: (issue.get("customfield_10202")==null ? null : (issue.get("customfield_10202").getTime() - (new Date()).getTime()) / 1000 ) -->

The very simple issue I have is that the result is displayed obviously as a negative value and I need it to be a positive value.

I have tried to reorder the same formula to subtract the date and time field from the current date and time but I get errors in the logs as I'm sure my formula is incorrect.

<!-- @@Formula: (new Date()).getTime()) / 1000 ) - (issue.get("customfield_10202")==null ? null : (issue.get("customfield_10202").getTime() -->

I've looked for examples and tweaked the formula but now run out of ideas.

Thanks.

1 answer

0 votes
David Thompson October 2, 2014

With a bit more thought and testing I used the below formula to get what I needed. No errors in the log so it looks good.

<!-- @@Formula: (issue.get("customfield_10202")==null ? null : (new Date()).getTime()) / 1000 - issue.get("customfield_10202").getTime() / 1000 -->

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events