import com.atlassian.jira.issue.Issue
import static java.lang.Math.*
import com.atlassian.jira.util.JiraKeyUtils
import java.lang.String
def startTime = System.currentTimeMillis();
def query = JiraKeyUtils.getIssueKeysFromString("project = DAFCEE AND status = Initial Customer Outreach")
def totalIssues = 0;
def totalTime = 0;
for ( issue in query )
{totalIssues += 1;
def workflowAction = issue.getActions();
def timeSpent = workflowAction.getTimeSpent();
totalTime += timeSpent;
}
def endTime = System.currentTimeMillis();
def totalTimeinMinutes = totalTime /60000;
def totalTimeInHours = totalTimeinMinutes / 60;
println("It takes " + totalTimeInHours + " hours and " + totalTimeinMinutes / 60 + " minutes for " + totalIssues + " issues with the project DAFCEE to move from the status as Initial Customer Outreach to In Evaluation in a workflow.");
println("Time Elapsed: " + (endTime - startTime) + "ms");