Can't pull time spent on an issue

James Lei-Butters December 3, 2013

I am trying to pull time spent to calculate the cost of an issue, but am unable to do so. Does anyone see something wrong with what I am doing?

<!-- @@Formula: 

public static double CalculateSubTotal(Double timeSpent) {
	if (timeSpent != null) {
		return timeSpent * 60;
	}
	else {
		return 0;
	}
}

CalculateSubTotal(Double.parseDouble(issue.get("timespent")))

 -->

1 answer

1 accepted

0 votes
Answer accepted
David _old account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 4, 2013

The Time Spend field is of type Long, not String. So your formula should look like:

<!-- @@Formula: 
 
public static double CalculateSubTotal(Long timeSpent) {
    if (timeSpent != null) {
        return timeSpent * 60;
    }
    else {
        return 0;
    }
}
 
CalculateSubTotal(issue.get("timespent"))
 
 -->

James Lei-Butters December 4, 2013

I figured it was something simple, but just couldn't see it. Thank you!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events