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

How to get Iteration id out of it's UUID ?

Hello,

I want to get iteration id value out of work-item field.
itemCopy.getTarget().getItemId();
itemCopy.getValue(TargetAttribute).toString().trim();
both gives me the UUID of the iteration but I need it's name.
How can I get the iteration name out of it's UUID ?

Thanks.

0 votes


Accepted answer

Permanent link
Please see the article https://jazz.net/library/article/807

It has the ID of a build result creates a handle from the UUIDand fetches the information. The code for an iteration should be similar. This should work on client and on the server (using a service and not the itemmanager)

  IBuildResultHandle resultHandle = (IBuildResultHandle) IBuildResult.ITEM_TYPE.createItemHandle(UUID.valueOf(buildResultID), null);
      ArrayList handleList = new ArrayList();
      handleList.add(resultHandle);
      IFetchResult fetchResult = aTeamRepository.itemManager().fetchCompleteItemsPermissionAware(handleList, IItemManager.REFRESH, null);

Yehiel Glass selected this answer as the correct answer

0 votes

Comments

Thanks Ralph !

My code:

IIterationHandle plannedForField = item.getTarget();

IIteration iteration = (IIteration) itemService.fetchItem(plannedForField, null);

String iterationLabal = iteration.getLabel();


One other answer

Permanent link

Hi Yehiel,

There are a few jazz.net questions similar to this. Not sure if they are helpful here:

https://jazz.net/forum/questions/65253/create-or-delete-iteration-and-timelines-programatically

https://jazz.net/forum/questions/90099/how-to-get-and-set-the-iteration-targetid-using-java-api

0 votes

Comments

Hello Kot,

I saw the links and can get the development line label:

operation.getDevelopmentLine().getLabel();

but i get the current iteration while I need to have the iteration lable that was choosen in the Work-item .

How can I get the string in the field "planned for" in the Work-item ?

Thanks,

Yehiel

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
× 10,938

Question asked: Jun 12 '13, 5:09 a.m.

Question was seen: 5,841 times

Last updated: Jul 18 '13, 10:01 a.m.

Confirmation Cancel Confirm