Server extension api - Find out if IIteration object is set as backlog
One answer
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.
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.
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:
- Put in an ignore annotation, be aware that an internal API can change and ignore the warning
-
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.