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

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

0 votes



4 answers

Permanent link
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

1 vote

Comments

Nice & Great


Permanent link
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

0 votes


Permanent link
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

0 votes


Permanent link
Hi Sridevi,
thanks, that works like a charm :-)

kind regards
Florian

0 votes

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,941

Question asked: Jun 04 '10, 4:19 a.m.

Question was seen: 7,822 times

Last updated: Nov 19 '13, 11:11 a.m.

Confirmation Cancel Confirm