SOAP API - Get tasks of a specific release

Wednesday, May 27, 2015
Avatar
Hi,

we’re using SpiraTeam 4.2.0.6 and we would like to use the (Java) SOAP API to get all tasks of a specific release. We tried it with the code below, but the filter doesn't work, taskRetrieve() always returns all tasks of all releases. How to get all tasks of a certain release?

ObjectFactory objectFactory;
objectFactory = new ObjectFactory();

RemoteFilter remoteFilter = objectFactory.createRemoteFilter();
remoteFilter.setPropertyName(objectFactory.createRemoteTaskDescription("ReleaseId"));
remoteFilter.setIntValue(objectFactory.createRemoteTaskReleaseId(release.getReleaseId().getValue()));

ArrayOfRemoteFilter remoteFilterArray = objectFactory.createArrayOfRemoteFilter();
remoteFilterArray.getRemoteFilter().add(remoteFilter);

taskArray = this.spiraImportExport.taskRetrieve(remoteFilterArray, remoteSort, 0, Integer.MAX_VALUE);

Regards
Thomas

2 Replies
Saturday, May 30, 2015
Avatar
inflectra.jimx
re: hein Wednesday, May 27, 2015
Hi Thomas

It should work, however you may need to change:

remoteFilter.setPropertyName(objectFactory.createRemoteTaskDescription("ReleaseId"));
to

remoteFilter.setPropertyName("ReleaseId");

Regards
Jim
Wednesday, June 24, 2015
Avatar
re: inflectra.jimx Saturday, May 30, 2015
Hi Jim,

if I change
        remoteFilter.setPropertyName(objectFactory.createRemoteTaskDescription("ReleaseId"));
to
        remoteFilter.setPropertyName("ReleaseId");

I get the error "incompatible types: String cannot be converted to JAXBElement<String>".

Regards
Thomas

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Wednesday, May 27, 2015
  • Last Reply: Wednesday, June 24, 2015
  • Replies: 2
  • Views: 8524