It's all about the answers!

Ask a question

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


Sian O'Briain (35921) | asked Mar 15 '17, 12:57 p.m.

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?

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Mar 16 '17, 4:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Comments
Sian O'Briain commented Mar 16 '17, 12:21 p.m.

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


Sian O'Briain commented Mar 16 '17, 12:41 p.m.

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


1
Ralph Schoon commented Mar 16 '17, 1:24 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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.


Sian O'Briain commented Mar 16 '17, 1:55 p.m. | edited Mar 16 '17, 1:57 p.m.

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


Ralph Schoon commented Mar 16 '17, 4:54 p.m. | edited Mar 16 '17, 5:17 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Ralph Schoon commented Mar 17 '17, 4:08 a.m. | edited Mar 17 '17, 4:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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 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.