It's all about the answers!

Ask a question

How do i programatically get revision time of build definition from history of build definition?


Deepthi Gogineni (613) | asked Jun 19 '14, 12:35 p.m.
edited Jun 19 '14, 3:19 p.m.

Hi All,

I am trying to get Creation date of build definition.I am following the below approach.

First i am trying to retrieve the build definition history.From that i will take the "Revision Time" and get the first "Revision Time".

here i got stuck..In RTC ,i am able to get only last modified date as BuildDefinition.modified().How can i get the revision time(i mean all the modified dates for particular build definition)?I am in RTC 4.0.5

Here is the code ..

if

(bd.hasHistory())

{

IBuildDefinitionQueryModel iBuildDefinitionQueryModel = IBuildDefinitionQueryModel.

ROOT;

IItemQuery query = IItemQuery.

FACTORY.newInstance(iBuildDefinitionQueryModel);

query.filter((iBuildDefinitionQueryModel.modified()._eq((query.newDateTimeArg()))));

query.orderByAsc(iBuildDefinitionQueryModel.modified());

IProgressMonitor monitor =

new NullProgressMonitor();

ITeamBuildClient buildClient = (ITeamBuildClient)

teamRepository.getClientLibrary(ITeamBuildClient.class);

Object[] parameters =

new Object[] { bd.modified()};

List result = 

null;

try {

IItemQueryPage queryPage = buildClient.queryItems(query, parameters, IQueryService.

ITEM_QUERY_MAX_PAGE_SIZE, monitor);

  

if (queryPage.getSize() != 0) {

result =

teamRepository.itemManager().fetchCompleteItems(queryPage.getItemHandles(), IItemManager.DEFAULT, monitor);

}

}

catch (IllegalArgumentException e) {

}

catch (TeamRepositoryException e) {

}

}

Be the first one to answer this question!


Register or 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.