SOAP API - Get tasks of a specific release

Wednesday, May 27, 2015 2:42:28 PM
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 1:15:31 PM
Avatar
re: hein on Wednesday, May 27, 2015 2:42:28 PM
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 11:20:08 AM
Avatar
re: inflectra.jimx on 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

Statistics
  • Started: Wednesday, May 27, 2015 2:42:28 PM
  • Last Reply: Wednesday, June 24, 2015 11:20:08 AM
  • Replies: 2
  • Views: 1389