Using the Java API, how does one determine if a build is 'Overdue'?
![]()
I can get the start time of a build, then the current time, and calculate how long it's been running, but I'm hoping there's an easier, pre-canned solution.
Thanks in advance.
|
Accepted answer
![]()
I'm pretty sure the overdue flag is based on the idea that a build is overdue if it's past the average build time of that build. You can get the average build time using the below code (shamelessly stolen example code from: https://jazz.net/library/article/1229).
IItemManager itemManager = repo.itemManager() IBuildAverageDataHandle buildAverageData = definition.getBuildAverageData(); IBuildAverageData data = (IBuildAverageData)itemManager.fetchCompleteItem(buildAverageData, IItemManager.DEFAULT, myProgressMonitor); /* The average build time is not available from the handle. It has to be fetched from the server. */ long averageBuildTime = data.getAverageBuildTimeTaken(); Todd Strangio selected this answer as the correct answer
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.