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.

new Date().getTime()

or for example: 7 days after creation

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.

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 }