Trying to find a Post-Function groovy script that can accomplish the need to:
- set the "Due Date"
- Only count Monday to Friday as viable days
- based on the "Original Estimate"
- But only when the task transitions from "To Do --> In Progress".
I am guessing that i would need to call an event to store the "original estimate" and then add that to the "new Date()" and then copy that to the due date.
Something along the lines of:
import java.text.SimpleDateFormat;
import java.util.Date;
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy");
Date dt = new Date();
long time = (dt.getTime()+(issue.get("timeoriginalestimate")/3600)/8);
String duedate = sdf.format(time);
Currently there are tasks that are estimated but cannot be started due to others in priority, therefore i cannot set a due date on an item.