I try to get remaining estimate field value of certain issues.
But it gives me false data (in milliseconds)
why?
----------------------------
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.component.ComponentAccessor
def issueInput = "foo-19852"
IssueManager issueManager = ComponentAccessor.getIssueManager()
def issue = issueManager.getIssueObject(issueInput)
def issueId = issue.getId()
def remainingEstimate = issue.getEstimate()
log.debug("remainingEstimate: ${remainingEstimate}")
----------------------
output:
remainingEstimate: 288000
---------------------
The actual remaining for this issue is: 2w
Hi @Noam Twena ,
What is the output if you convert the milliseconds ?
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.util.TimeTrackingUtils
def issueInput = "foo-19852"
IssueManager issueManager = ComponentAccessor.getIssueManager()
def issue = issueManager.getIssueObject(issueInput)
def issueId = issue.getId()
def remainingEstimateMillis = issue.getEstimate()
def remainingEstimateFormatted = TimeTrackingUtils.formatDuration(remainingEstimateMillis)
log.debug("remainingEstimate: ${remainingEstimateFormatted}")
Or ... is it possible that the result is in seconds ? It could be correct : 288000 seconds = 80 hours ... that's 10 working days of 8 hours
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.
I would try with TimeTrackingUtils.formatDuration(remainingEstimateMillis)
Just to be sure it's 0 also :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
well unfortunately in the docs it says that the return value is in milliseconds:
288000 from milliseconds to days in google give this number: 0.00333333333
so it doesn't really matter how I convert it
because the data I get doesn't make sense
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok thanks @Frederik Vantroys , found by rest api call that this field is indeed calculated in seconds,
and indeed it makes sense that 288000 seconds are 2 weeks.
The return value in the docs is incorrect:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad it worked out.
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.