How to define a condition for a 'later' date (of two fields)

Martin Mintál August 29, 2014

Hi. We use a field called 'Calculated Date/Time'. This field should display one of the following values:

<!-- @@Formula: issue.get("updated") -->

<!-- @@Formula: issue.get("customfield_10100") -->

Always the bigger one. So if 'updated' is a later date, than the value of this field should be displayed (in the 'Calculated Date/Time' etc... you get the point. So the question is, how to create a condition which would display only the 'later' date. Thank you very much for your help.

1 answer

1 accepted

1 vote
Answer accepted
David _old account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2014

You might want to try something like:

if (issue.get("customfield_10100") == null &amp;&amp; issue.get("updated") == null) return null;
if (issue.get("customfield_10100") == null) return issue.get("updated");
if (issue.get("updated") == null) return issue.get("customfield_10100");
if (issue.get("customfield_10100").getTime() &gt; issue.get("updated").getTime())
  return issue.get("customfield_10100");
else
  return issue.get("updated");

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events