It's all about the answers!

Ask a question

How to resolve "Planned for" iteration handle in A


Florian Georg (19031918) | asked Jun 04 '10, 4:19 a.m.
I'm currently doing a custom process pre-condition (on WorkItem Save), which should look at the target "Planned For" attribute.

However, all I got back by looking at the WorkItem instance is an IIterationHandle.

So the general question is (as these handles are around everywhere): How do I resolve handles to the actual repository items?
I saw some code using ITeamRepository, but it seems that I don't have such a thing available inside my Advisor implementation (or the supplied save Parameter).

Thanks for any hints.
Florian

4 answers



permanent link
Florian Georg (19031918) | answered Jun 08 '10, 6:09 p.m.
Hi Sridevi,
thanks, that works like a charm :-)

kind regards
Florian

permanent link
Florian Georg (19031918) | answered Jun 08 '10, 4:57 a.m.
I'm currently doing a custom process pre-condition (on WorkItem Save), which should look at the target "Planned For" attribute.

However, all I got back by looking at the WorkItem instance is an IIterationHandle.

So the general question is (as these handles are around everywhere): How do I resolve handles to the actual repository items?
I saw some code using ITeamRepository, but it seems that I don't have such a thing available inside my Advisor implementation (or the supplied save Parameter).

Thanks for any hints.
Florian


Hi,

Are you creating a client side advisor or a server side advisor?

Thanks,
Sridevi
Jazz Process Team


Hi,
first of all it's a server side Advisor, hooked into the WorkItemSave operation.
However, I also plan a client side component ("Quick Fix Provider"), so both cases would be of interest for me.
Generally speaking I have a hard time to figure out how to pass around data/handles from server side to client side, and how to resolve these handles on either side.

thanks for any hints
Florian

permanent link
Sridevi Sangaiah (59179) | answered Jun 06 '10, 11:35 p.m.
JAZZ DEVELOPER
I'm currently doing a custom process pre-condition (on WorkItem Save), which should look at the target "Planned For" attribute.

However, all I got back by looking at the WorkItem instance is an IIterationHandle.

So the general question is (as these handles are around everywhere): How do I resolve handles to the actual repository items?
I saw some code using ITeamRepository, but it seems that I don't have such a thing available inside my Advisor implementation (or the supplied save Parameter).

Thanks for any hints.
Florian


Hi,

Are you creating a client side advisor or a server side advisor?

Thanks,
Sridevi
Jazz Process Team

permanent link
Sridevi Sangaiah (59179) | answered Jun 08 '10, 9:47 a.m.
JAZZ DEVELOPER
I'm currently doing a custom process pre-condition (on WorkItem Save), which should look at the target "Planned For" attribute.

However, all I got back by looking at the WorkItem instance is an IIterationHandle.

So the general question is (as these handles are around everywhere): How do I resolve handles to the actual repository items?
I saw some code using ITeamRepository, but it seems that I don't have such a thing available inside my Advisor implementation (or the supplied save Parameter).

Thanks for any hints.
Florian


Hi,

Are you creating a client side advisor or a server side advisor?

Thanks,
Sridevi
Jazz Process Team


Hi,
first of all it's a server side Advisor, hooked into the WorkItemSave operation.
However, I also plan a client side component ("Quick Fix Provider"), so both cases would be of interest for me.
Generally speaking I have a hard time to figure out how to pass around data/handles from server side to client side, and how to resolve these handles on either side.

thanks for any hints
Florian

Hi,

In the server side, once we have an item handle com.ibm.team.repository.service.IRepositoryItemService.fetchItem(IItemHandle, String[]) can be used to fetch the item. It would look like

IIteration iteration = getService(IRepositoryItemService.class).fetchItem(iterationHandle, IRepositoryItemService.COMPLETE)

To have access to the getService() method the server side advisor should extend com.ibm.team.repository.service.AbstractService.java. The steps are detailed in https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide#Adding_New_Operation_Advisors.

In the client side advisor, code to fetch an item using its handle would look like

IProcessArea processArea = operation.getProcessArea(); //operation is the AdvisableOperation instance passed to the client side advisor
ITeamRepository repository = (ITeamRepository) processArea.getOrigin();
IItemManager itemManager = repository.itemManager();
IIteration iteration = (IIteration) itemManager.fetchCompleteItem(iterationHandle, IItemManager.DEFAULT, monitor);

Thanks,
Sridevi
Jazz Process Team

Comments
Albert Yao commented Nov 19 '13, 11:11 a.m.

Nice & Great

Your answer


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.