Knowledge Base Article

Home Page > Knowledge Base > Spira Platform > SpiraTeam

Home Page > Knowledge Base > Spira Platform > SpiraTest

Article How to get the ID of a test case from it's name using SOAP web services

by Adam S on Monday, November 26, 2012

This article describes the process for calling SpiraTest / SpiraTeam using its SOAP web service API to query the system to retrieve a list of test cases that match a specific name so that you can obtain its test case id.

You need to do the following:

1) Authenticate with SpiraTeam and connect to the project

   spiraImportExport.Connection_Authenticate("fredbloggs", "fredbloggs");

2) Create the filter to retrieve test cases that match the name 'Test Case 1'

   List<RemoteFilter> remoteFilters = new List<RemoteFilter>();
   RemoteFilter remoteFilter = new RemoteFilter();
   remoteFilter.PropertyName = "Name";
   remoteFilter.StringValue = "Test Case 1";

3) Now retrieve the results

RemoteTestCase[] remoteTestCases = spiraImportExport.TestCase_Retrieve(remoteFilters.ToArray(), 1, 999999);

4) Finally get the test case id from the results

RemoteTestCase matchingTestCase = remoteTestCases[0];
int testCaseId = matchingTestCase.TestCaseId.Value;


Article Info
Last Updated: 11/26/2012
Article ID: KB29
# Views: 1918
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2017 | Licensed to Inflectra Corporation.