• Community
  • Products
  • Jira
  • Questions
  • How can i calculate the number of dates from a date picker custom field to resolution date using misc custom fields

How can i calculate the number of dates from a date picker custom field to resolution date using misc custom fields

Trying to calculate number of dates from custom field 'date received' till the resolution date.


I tried to do it myself with this code below but it didnt work sad any help would be greatly appreciated.


<!-- @@Formula: (issue.resolutionDate != null) != null ? issue.resolutionDate.getDate() : null) - (issue.get("customfield_10002") != null ? issue.get("customfield_10002") : null) -->

2 answers

1 accepted

The Resolution Date is retrieved using:

issue.get("resolutiondate")

See https://innovalog.atlassian.net/wiki/x/BYAbAg

So your formula would look like (assuming you want a number of days):

&lt;!-- @@Formula: 
if (issue.get("resolutiondate") == null || issue.get("customfield_10002")==null)
  return null;
return (issue.get("resolutiondate").getTime() - issue.get("customfield_10002").getTime()) / (1000*60*60*24);
 --&gt;

excellent! i am still trying to learn this language, it is a lot different to BASIC which is what i've come from.

I do have one question, is there anyway to exclude weekends? if it is too complicated then do not worry as we can simply change the date received to manipulate the total days.

Thank you for your help greatly appreciated!!

This question was answered before here on Answers. You should search within this site.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,089 views 13 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot