Formula field (date) and examples

The has field has standard date time search functions in Jira.

Formula (JavaScript): return date

The script must return a numeric representation of the date as a number or string of number for constructor new Date(value) doc.

1 new Date().getTime()

or for example: 7 days after creation

1 issue.getCreated().getTime() + 7*24*60*60*1000

 

 

Date custom field + days(number) from another custom fields

This script returns the date of the specified field increased by the number of days from the second field.

1 2 3 4 5 var dateCustomFieldId = 10101;//Date picker var daysCustomFieldId = 10200;//Number field if(cfValues[dateCustomFieldId] != null){ cfValues[dateCustomFieldId].time + cfValues.getOrDefault(daysCustomFieldId, 0)*24*60*60*1000 }