See all operations
POST: projects/{project_id}/test-cases
Description
Creates a new test case in the system. Name, TestCaseStatusId, and TestCaseTypeId are required fields.
How to Execute
To access this REST web service, you need to use the following URL (make sure to replace any parameters (eg {project_id}) with the relevant value (eg 1):
https://api.inflectra.com/Spira/Services/v6_0/RestService.svc/projects/{project_id}/test-cases
Request Parameters
Name
|
Description
|
project_id
|
The id of the current project
|
Request Body
Property
|
Description
|
TestCaseId
|
The id of the test case
|
ExecutionStatusId
|
The execution status id of the test case
|
AuthorId
|
The id of the user that wrote the test case
The authenticated user is used if no value is provided
|
OwnerId
|
The id of the user that the test case is assigned-to
|
TestCasePriorityId
|
The id of the priority of the test case
|
TestCaseTypeId
|
The type of test case, pass null to use the default value
|
TestCaseStatusId
|
The status of the test case, pass 0 to use the default value
|
TestCaseFolderId
|
The id of the folder the test case belongs to. Null = root folder
|
ComponentIds
|
The list of components that this test case belongs to
|
AutomationEngineId
|
The id of the automation engine the associated test script uses (null if manual only)
|
AutomationAttachmentId
|
The id of the attachment that is being used to store the test script (file or url)
Null if manual only
|
Name
|
The name of the test case
|
Description
|
The description of the test case
|
CreationDate
|
The date the test case was created
|
LastUpdateDate
|
The date the test case was last updated
|
ExecutionDate
|
The date the test case was last executed
|
EstimatedDuration
|
The estimated time to execute the test case
|
TestSteps
|
The list of test steps that comprise the test case
|
ActualDuration
|
The actual result from the most recent test run of the this test case
|
ProjectId
|
The id of the project that the artifact belongs to
|
ConcurrencyDate
|
The datetime used to track optimistic concurrency to prevent edit conflicts
|
CustomProperties
|
The list of associated custom properties/fields for this artifact
|
Tags
|
The list of meta-tags that should be associated with the artifact
|
<RemoteTestCase xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v6_0.DataObjects">
<ArtifactTypeId>0</ArtifactTypeId>
<ConcurrencyDate>0001-01-01T00:00:00</ConcurrencyDate>
<CustomProperties i:nil="true" />
<IsAttachments>false</IsAttachments>
<ProjectId>0</ProjectId>
<Tags i:nil="true" />
<ActualDuration i:nil="true" />
<AuthorId i:nil="true" />
<AuthorName i:nil="true" />
<AutomationAttachmentId i:nil="true" />
<AutomationEngineId i:nil="true" />
<ComponentIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" />
<CreationDate>0001-01-01T00:00:00</CreationDate>
<Description i:nil="true" />
<EstimatedDuration i:nil="true" />
<ExecutionDate i:nil="true" />
<ExecutionStatusId i:nil="true" />
<ExecutionStatusName i:nil="true" />
<IsSuspect>false</IsSuspect>
<IsTestSteps>false</IsTestSteps>
<LastUpdateDate>0001-01-01T00:00:00</LastUpdateDate>
<Name i:nil="true" />
<OwnerId i:nil="true" />
<OwnerName i:nil="true" />
<ProjectName i:nil="true" />
<TestCaseFolderId i:nil="true" />
<TestCaseId i:nil="true" />
<TestCasePriorityId i:nil="true" />
<TestCasePriorityName i:nil="true" />
<TestCaseStatusId>0</TestCaseStatusId>
<TestCaseStatusName i:nil="true" />
<TestCaseTypeId i:nil="true" />
<TestCaseTypeName i:nil="true" />
<TestSteps i:nil="true" />
</RemoteTestCase>
{"TestCaseId":null,
"ExecutionStatusId":null,
"AuthorId":null,
"OwnerId":null,
"TestCasePriorityId":null,
"TestCaseTypeId":null,
"TestCaseStatusId":0,
"TestCaseFolderId":null,
"ComponentIds":null,
"AutomationEngineId":null,
"AutomationAttachmentId":null,
"Name":null,
"Description":null,
"CreationDate":"0001-01-01T00:00:00",
"LastUpdateDate":"0001-01-01T00:00:00",
"ExecutionDate":null,
"EstimatedDuration":null,
"AuthorName":null,
"OwnerName":null,
"ProjectName":null,
"TestCasePriorityName":null,
"TestCaseStatusName":null,
"TestCaseTypeName":null,
"ExecutionStatusName":null,
"TestSteps":null,
"ActualDuration":null,
"IsSuspect":false,
"IsTestSteps":false,
"ProjectId":0,
"ArtifactTypeId":0,
"ConcurrencyDate":"0001-01-01T00:00:00",
"CustomProperties":null,
"IsAttachments":false,
"Tags":null}
Return Data
The JSON and XML examples below show the shape of one entry that will be returned. It does not show an example of how that entry will be populated.
Property
|
Description
|
TestCaseId
|
The id of the test case
|
ExecutionStatusId
|
The execution status id of the test case
|
AuthorId
|
The id of the user that wrote the test case
The authenticated user is used if no value is provided
|
OwnerId
|
The id of the user that the test case is assigned-to
|
TestCasePriorityId
|
The id of the priority of the test case
|
TestCaseTypeId
|
The type of test case, pass null to use the default value
|
TestCaseStatusId
|
The status of the test case, pass 0 to use the default value
|
TestCaseFolderId
|
The id of the folder the test case belongs to. Null = root folder
|
ComponentIds
|
The list of components that this test case belongs to
|
AutomationEngineId
|
The id of the automation engine the associated test script uses (null if manual only)
|
AutomationAttachmentId
|
The id of the attachment that is being used to store the test script (file or url)
Null if manual only
|
Name
|
The name of the test case
|
Description
|
The description of the test case
|
CreationDate
|
The date the test case was created
|
LastUpdateDate
|
The date the test case was last updated
|
ExecutionDate
|
The date the test case was last executed
|
EstimatedDuration
|
The estimated time to execute the test case
|
AuthorName
|
The display name of the user that wrote the test case
|
OwnerName
|
The display name of the user that the test case is assigned-to
|
ProjectName
|
The display name of the project that the test case belongs to
|
TestCasePriorityName
|
The display name of the priority of the test case
|
TestCaseStatusName
|
The display name of the status of the test case
|
TestCaseTypeName
|
The display name of the type of the test case
|
ExecutionStatusName
|
The display name of the execution status
|
TestSteps
|
The list of test steps that comprise the test case
|
ActualDuration
|
The actual result from the most recent test run of the this test case
|
IsSuspect
|
Have any of the requirements associated with this test case changed
|
IsTestSteps
|
Does this test case have steps
|
ProjectId
|
The id of the project that the artifact belongs to
|
ArtifactTypeId
|
The type of artifact that we have
|
ConcurrencyDate
|
The datetime used to track optimistic concurrency to prevent edit conflicts
|
CustomProperties
|
The list of associated custom properties/fields for this artifact
|
IsAttachments
|
Does this artifact have any attachments?
|
Tags
|
The list of meta-tags that should be associated with the artifact
|
<RemoteTestCase xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v6_0.DataObjects">
<ArtifactTypeId>0</ArtifactTypeId>
<ConcurrencyDate>0001-01-01T00:00:00</ConcurrencyDate>
<CustomProperties i:nil="true" />
<IsAttachments>false</IsAttachments>
<ProjectId>0</ProjectId>
<Tags i:nil="true" />
<ActualDuration i:nil="true" />
<AuthorId i:nil="true" />
<AuthorName i:nil="true" />
<AutomationAttachmentId i:nil="true" />
<AutomationEngineId i:nil="true" />
<ComponentIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" />
<CreationDate>0001-01-01T00:00:00</CreationDate>
<Description i:nil="true" />
<EstimatedDuration i:nil="true" />
<ExecutionDate i:nil="true" />
<ExecutionStatusId i:nil="true" />
<ExecutionStatusName i:nil="true" />
<IsSuspect>false</IsSuspect>
<IsTestSteps>false</IsTestSteps>
<LastUpdateDate>0001-01-01T00:00:00</LastUpdateDate>
<Name i:nil="true" />
<OwnerId i:nil="true" />
<OwnerName i:nil="true" />
<ProjectName i:nil="true" />
<TestCaseFolderId i:nil="true" />
<TestCaseId i:nil="true" />
<TestCasePriorityId i:nil="true" />
<TestCasePriorityName i:nil="true" />
<TestCaseStatusId>0</TestCaseStatusId>
<TestCaseStatusName i:nil="true" />
<TestCaseTypeId i:nil="true" />
<TestCaseTypeName i:nil="true" />
<TestSteps i:nil="true" />
</RemoteTestCase>
{"TestCaseId":null,
"ExecutionStatusId":null,
"AuthorId":null,
"OwnerId":null,
"TestCasePriorityId":null,
"TestCaseTypeId":null,
"TestCaseStatusId":0,
"TestCaseFolderId":null,
"ComponentIds":null,
"AutomationEngineId":null,
"AutomationAttachmentId":null,
"Name":null,
"Description":null,
"CreationDate":"0001-01-01T00:00:00",
"LastUpdateDate":"0001-01-01T00:00:00",
"ExecutionDate":null,
"EstimatedDuration":null,
"AuthorName":null,
"OwnerName":null,
"ProjectName":null,
"TestCasePriorityName":null,
"TestCaseStatusName":null,
"TestCaseTypeName":null,
"ExecutionStatusName":null,
"TestSteps":null,
"ActualDuration":null,
"IsSuspect":false,
"IsTestSteps":false,
"ProjectId":0,
"ArtifactTypeId":0,
"ConcurrencyDate":"0001-01-01T00:00:00",
"CustomProperties":null,
"IsAttachments":false,
"Tags":null}