Test Set API Calls
The API call we will be using is this one:
TestSet_Retrieve
Retrieves a list of testSets in the project (all folders) that match the provided filter
Parameters
Type | Name | Required |
---|
ArrayOfRemoteFilter? | remoteFilters - The list of filters to apply | |
RemoteSort? | remoteSort - The sort to use | |
int | startingRow - The first row to return (starting with 1) | Yes |
int | numberOfRows - The number of rows to return | Yes |
int? | releaseId - The id of the release, null = all releases | |
Return Value
ArrayOfRemoteTestSet - List of testSets
Code Sample
The following illustrates how to use this API:
//Now lets test that we can retrieve a generic list of test sets from the sample project
spiraSoapClient.Connection_Authenticate("fredbloggs", "PleaseChange");
spiraSoapClient.Connection_ConnectToProject(1);
RemoteSort remoteSort = new RemoteSort();
remoteSort.PropertyName = "Name";
remoteSort.SortAscending = true;
List<RemoteFilter> remoteFilters = new List<RemoteFilter>();
RemoteFilter remoteFilter = new RemoteFilter();
remoteFilter.PropertyName = "OwnerId";
remoteFilter.MultiValue = new MultiValueFilter();
remoteFilter.MultiValue.Values = new int[] { 2, 3 };
remoteFilters.Add(remoteFilter);
remoteFilter = new RemoteFilter();
remoteFilter.PropertyName = "TestSetStatusId";
remoteFilter.MultiValue = new MultiValueFilter();
remoteFilter.MultiValue.Values = new int[] { (int)Task.TaskStatusEnum.NotStarted, (int)Task.TaskStatusEnum.InProgress };
remoteFilters.Add(remoteFilter);
remoteFilter = new RemoteFilter();
remoteFilter.PropertyName = "PlannedDate";
remoteFilter.DateRangeValue = new DateRange();
remoteFilter.DateRangeValue.StartDate = DateTime.UtcNow.AddDays(-126);
remoteFilter.DateRangeValue.EndDate = DateTime.UtcNow.AddDays(-8);
remoteFilters.Add(remoteFilter);
RemoteTestSet[] remoteTestSets = spiraSoapClient.TestSet_Retrieve(remoteFilters.ToArray(), remoteSort, 1, 999999, null);