How to resolve "Planned for" iteration handle in A
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
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
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
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
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