Hi,
I want to be able to calculate the number of days between two dates and store the value in a field that can be used within a filter. This can be calculated and stored based on workflow as it would be calculated on the closure of the issue.
Javascript or free plugin in suggestions are welcome.
Thanks in advance
Dan
I used Kepler custom fields and a sil script custom field to acheive what was required.
Note: this does not return the days but the minutes between the dates, this needs to be divided by (60*working hours in a day as set in system*number of working days in the system) to provide the days.
I use a script field in Script Runner
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
import java.util.Date.*
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def dateFieldObject= customFieldManager.getCustomFieldObject('customfield_15968');
def dateFieldObject2= customFieldManager.getCustomFieldObject('customfield_15967');
if(issue.getCustomFieldValue(dateFieldObject) && issue.getCustomFieldValue(dateFieldObject2)) {
def dateValue = issue.getCustomFieldValue(dateFieldObject) as Date
def dateValue2 = issue.getCustomFieldValue(dateFieldObject2) as Date
def calculation = (dateValue - dateValue2)
return (calculation as String)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Look at scripted fields from Script runner plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.