Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes


Accepted answer

Permanent link
 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

1 vote

Comments

  Thanks Scott - this is exactly what I was looking for.  Appreciate the help.

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 562
× 8
× 1

Question asked: Jan 31 '13, 3:44 p.m.

Question was seen: 6,467 times

Last updated: Feb 01 '13, 1:49 p.m.

Confirmation Cancel Confirm