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

Server extension api - Find out if IIteration object is set as backlog

I am using SDK 6.0.3

I want to find out if the planned for field of a work item is set to the backlog....I don't think this is possible using IIteration methods, can you advise?

0 votes



One answer

Permanent link

I have spent some minutes searching the SDK for  public boolean isBacklog(); Note: you can do things like that too. I only have the SDK that anyone else has.


The method is found in com.ibm.team.apt.api.common.process.IIteration.isBacklog() . Note the Interface is a different one you use. It is a special adoption for agile planning. There are other interesting code pieces e.g. com.ibm.team.apt.internal.service.tools.ProcessItemResolver.isBacklogIteration(IIteration) .

You can probably find out if an iteration is a backlog iteration given the hints above, but I have no code for it.

1 vote

Comments

Thank you!
I was using: com.ibm.team.process.common.IIteration
Your suggestion should work fine and I have also figured out how to do the full search and update the build.properties to make the relevant plugins available. Thanks again

hmm the problem I now face is that I am getting the IIterationHandle using the workItem getTarget() method. It seems this handle can't be used with com.ibm.team.apt.api.common.process.IIteration

i.e.
IIteration new_iteration = (IIteration) itemService.fetchItem(workItemNewState.getTarget(), IRepositoryItemService.COMPLETE);

causes an error:

com.ibm.team.process.internal.common.impl.IterationImpl incompatible with com.ibm.team.apt.api.common.process.IIteration

 What you are seeing is that the apt - agile planning tools domain has its own API. It also has its own flavor data for parts of the data model. There seem to be ways to get the data connected, but that would be in the com.ibm.team.apt.* package code. 


The other issue here is, that the agile planning does not have aa real API and you will end up using classes that are internal.  I published one example here: https://rsjazz.wordpress.com/2015/06/11/creating-plans-with-the-plain-java-client-api/ 

I can't really help you without spending a lot of my own time digging into the API. You definitely need the RTC SDK set up and be able to see into the code that comes with the the SDK to do this.

1 vote

thanks I went a bit further and used the service you mentioned above:

ProcessItemResolver processResolver = (ProcessItemResolver) service.getService(ProcessItemResolver.class);

then the method:
processItemResolver.isBacklogIteration(new_iteration)

However I get the warning:
Discouraged access: The type ProcessItemResolver is not accessible due to restriction on required library /Users/sianob/rtc603/RTC-SDK-Server-6.0.3/plugins/com.ibm.team.apt.service_3.1.1500.v20161020_0459.jar

And when I deploy I get an unresolved compilation error. I am tempted to use an iterationType instead. I will set up my environment correctly (using the changes you mentioned for 6.0.3 in your blog) so I can debug properly. Thanks

The warning tells you not to touch the API, because it is internal - as I mantioned above.

You have two options:

  1. Put in an ignore annotation, be aware that an internal API can change and ignore the warning
  2. Find another way

I would go with 1 if I where you.

 I am not sure about the compilation error. You should test this stuff on Jetty if it is a server extension.


6.0.3 unfortunately the updated extensions workshop for 6.0.3 has not yet be published due to other site maintenance going on.

showing 5 of 6 show 1 more comments

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

Question asked: Mar 15 '17, 12:57 p.m.

Question was seen: 1,871 times

Last updated: Mar 17 '17, 4:14 a.m.

Confirmation Cancel Confirm