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

RTC Jazz Client API: How to get a work item category ID?

This is part of my code;

List<ICategory> findCategories= workItemService.findCategories(projectArea, ICategory.FULL_PROFILE, null);
Iterator<ICategory> i = findCategories.iterator();

        while(i.hasNext()){
        ICategory ic = i.next();
        ICategoryHandle categoryHandle = (ICategoryHandle)ic;
        ICategory category = (ICategory) repo.itemManager()
.fetchCompleteItem(categoryHandle, IItemManager.DEFAULT, null);

                 ........

I can use category.getName() to get category name but how can I get the category item_id? It looks like this: _4q8WEMlTEeKzqIh7h7lAkg

I tried category.g getCategoryId() but it doesn't give me what I want. 

Thansk!!!!

0 votes


Accepted answer

Permanent link
Because ICategory is an auditable, the method getItemId should work

from the SDK

getItemId

UUID getItemId()
Returns the item id of this item. The item id gives items their identity.

Returns:
the item id; never null

Clement Liu selected this answer as the correct answer

0 votes

Comments

Oops, I did miss that. Thank you, Sam. 

and you know, in Eclipse, if you type the . after the variable name and wait, it will pop up all methods available.  and it will show you their return data types.

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
× 12,019

Question asked: Apr 21 '14, 5:15 p.m.

Question was seen: 4,845 times

Last updated: Apr 21 '14, 6:35 p.m.

Confirmation Cancel Confirm