Is there a Project Area Id? (PlainJavaAPI)
![]()
I failed to find a function named "findProjectAreaById()" on PlainJavaAPI, so I decide to make one. If it already exists please read no further and just tell me where I get it :)
So, I'm trying to build a dynamic query, which I think it's faster (Am I right?). I build this piece of code:
I call it on something like
Where areaId is a string previously obtained with: ProjectArea.getItemId().getUuidValue(); But I get "Incorrectly typed parameter submitted to query; Parameter 0 was class java.lang.String but com.ibm.team.repository.common.UUID was expected" How is the UUID calculated? I didn't found a way to convert com.ibm.team.repository.common.UUID into something standard and back to com.ibm.team.repository.common.UUID. Is the UUID generated from ProjectArea name? I have found an ProjectAreaQueryModel.ROOT.uniqueName() that I could use on query, but I didn't found the associated IProjectArea property id. |
5 answers
![]()
Never mind... beginner mistake...
The error was at line: Object[] parameters= new Object[] { IProjectArea.ITEM_ID_PROPERTY, id }; that obviously should be: Object[] parameters= new Object[] { id }; -- I'd mixed two queries techniques :) |
![]()
You can try to use IRepositoryItemService to retrive the project area:
IProjectAreaHandle handle = IProjectArea.ITEM_TYPE.createItemHandle(uuid, null); IRepositoryItemService service = ... // get service try { service.fetchItem(handle, ...); } catch ... |
![]()
If your code is in client side, you can use
ITeamRepository.itemManager().fetchCompleteItem(handle, ...) |
![]()
Jared Burns (4.5k●2●9)
| answered Dec 06 '10, 6:24 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Also, please note that any classes in a package with "internal" in the name are not API. The code snippet posted above is referencing the ProjectAreaQueryModel, which is just such a class.
This class is an internal implementation detail of the Process runtime and should not be accessed by third parties. Jonathan's suggested path of using the IItemManager or IRepositoryItemService is the correct route. - Jared |
![]() Also, please note that any classes in a package with "internal" in the name are not API. The code snippet posted above is referencing the ProjectAreaQueryModel, which is just such a class. If these type of query isn't API, why in jazz Wiki, "Developer's Guide to Querying Work Items https://jazz.net/wiki/bin/view/Main/QueryDevGuide". The JazzTeam says: "To illustrate Not only that but there they also said: "The dynamic query model is aimed at those occasions where a query needs to be created dynamically at runtime and only the attribute identifiers are known." Which is exactly my case, once I only know the attribute identifier ItemID, but not the parameter. The documentation isn't that great already, and if we couldn't trust what is written... Then we have troubles... |
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.