<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: REST API creating test sets (Thread)</title><description>   Hello,          I'm a novice user of SpiraTeam as my organization have selected it as our main tool for requirements / test case generation.  I've begun looking at the available REST API and am attempting to utilize it to create a simple test set.  I'm a bit confused with all the elements in the request payload and would hope to get some guidance and clarity.          I'm specifically looking at:  POST: projects/{project_id}/test-sets?parent_test_set_folder_id={parent_test_set_folder_id}         I've tried the following POST Request:          http://hostname/SpiraTeam/Services/v4_0/RestService.svc/projects/284/test-sets?parent_test_set_folder_id=13242         Headers:    Cache-Control: no-cache    username: johndoe    api-key: {187FC923-CE4F-4FCA-BEF0-73D7A37055F2}    Accept: application/json    Content-Type: application/json         Post Body:    {"ArtifactTypeId": 8,    "ConcurrencyDate": "/Date(1432130443523-0700)/",    "CustomProperties": [0],    "ProjectId": 284,    "AutomationHostId": null,    "CountBlocked": 0,    "CountCaution": 0,    "CountFailed": 0,    "CountNotApplicable": 0,    "CountNotRun": 0,    "CountPassed": 0,    "CreationDate": "/Date(1432130413227-0700)/",    "CreatorId": 968,    "CreatorName": "John Doe",    "Description": null,    "ExecutionDate": null,    "Folder": false,    "IndentLevel": "AAJAAAs",    "LastUpdateDate": "/Date(1432130443523-0700)/",    "Name": "RESTAPI",    "OwnerId": null,    "OwnerName": null,    "PlannedDate": null,    "ProjectName": "Test Project",    "RecurrenceId": null,    "RecurrenceName": null,    "ReleaseId": null,    "ReleaseVersionNumber": null,    "TestRunTypeId": null,    "TestSetId": null,    "TestSetStatusId": 3,    "TestSetStatusName": "Completed"}              What is a valid request body?  I'm receiving the following error.  Any help pointing me in the right direction would be greatly appreciated.  I don't have access to the server logs so I can not view more details to see where the issue is.                Request Error            The server encountered an error processing the request. The exception message is 'Expecting state 'Element'.. Encountered 'Text'  with name '', namespace ''. '. See server logs for more details. The exception stack trace is:                at System.Runtime.Serialization.XmlObjectSerializerReadContext.HandleMemberNotFound(XmlReaderDelegator xmlReader, ExtensionDataObject extensionData, Int32 memberIndex)       at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.GetJsonMemberIndex(XmlReaderDelegator xmlReader, XmlDictionaryString[] memberNames, Int32 memberIndex, ExtensionDataObject extensionData)       at ReadRemoteArtifactCustomPropertyFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )       at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract dataContract)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)       at ReadArrayOfRemoteArtifactCustomPropertyFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString , CollectionDataContract )       at System.Runtime.Serialization.Json.JsonCollectionDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract dataContract)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)       at ReadRemoteTestSetFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )       at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract dataContract)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)       at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)       at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)       at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)       at System.ServiceModel.Dispatcher.SingleBodyParameterDataContractMessageFormatter.ReadObject(Message message)       at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.DeserializeRequest(Message message, Object[] parameters)       at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters)       at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc rpc)       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc rpc)       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc rpc)       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc rpc)       at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)    </description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/spirateam/issues-questions/1347.aspx</link><item><guid isPermaLink="false">threadId=1347</guid><author>D W (dkwang@directv.com)</author><category domain="http://www.inflectra.com/kronodesk/thread/tag">rest</category><category domain="http://www.inflectra.com/kronodesk/thread/tag"> api</category><title>REST API creating test sets</title><description>   Hello,          I'm a novice user of SpiraTeam as my organization have selected it as our main tool for requirements / test case generation.  I've begun looking at the available REST API and am attempting to utilize it to create a simple test set.  I'm a bit confused with all the elements in the request payload and would hope to get some guidance and clarity.          I'm specifically looking at:  POST: projects/{project_id}/test-sets?parent_test_set_folder_id={parent_test_set_folder_id}         I've tried the following POST Request:          http://hostname/SpiraTeam/Services/v4_0/RestService.svc/projects/284/test-sets?parent_test_set_folder_id=13242         Headers:    Cache-Control: no-cache    username: johndoe    api-key: {187FC923-CE4F-4FCA-BEF0-73D7A37055F2}    Accept: application/json    Content-Type: application/json         Post Body:    {"ArtifactTypeId": 8,    "ConcurrencyDate": "/Date(1432130443523-0700)/",    "CustomProperties": [0],    "ProjectId": 284,    "AutomationHostId": null,    "CountBlocked": 0,    "CountCaution": 0,    "CountFailed": 0,    "CountNotApplicable": 0,    "CountNotRun": 0,    "CountPassed": 0,    "CreationDate": "/Date(1432130413227-0700)/",    "CreatorId": 968,    "CreatorName": "John Doe",    "Description": null,    "ExecutionDate": null,    "Folder": false,    "IndentLevel": "AAJAAAs",    "LastUpdateDate": "/Date(1432130443523-0700)/",    "Name": "RESTAPI",    "OwnerId": null,    "OwnerName": null,    "PlannedDate": null,    "ProjectName": "Test Project",    "RecurrenceId": null,    "RecurrenceName": null,    "ReleaseId": null,    "ReleaseVersionNumber": null,    "TestRunTypeId": null,    "TestSetId": null,    "TestSetStatusId": 3,    "TestSetStatusName": "Completed"}              What is a valid request body?  I'm receiving the following error.  Any help pointing me in the right direction would be greatly appreciated.  I don't have access to the server logs so I can not view more details to see where the issue is.                Request Error            The server encountered an error processing the request. The exception message is 'Expecting state 'Element'.. Encountered 'Text'  with name '', namespace ''. '. See server logs for more details. The exception stack trace is:                at System.Runtime.Serialization.XmlObjectSerializerReadContext.HandleMemberNotFound(XmlReaderDelegator xmlReader, ExtensionDataObject extensionData, Int32 memberIndex)       at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.GetJsonMemberIndex(XmlReaderDelegator xmlReader, XmlDictionaryString[] memberNames, Int32 memberIndex, ExtensionDataObject extensionData)       at ReadRemoteArtifactCustomPropertyFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )       at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract dataContract)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)       at ReadArrayOfRemoteArtifactCustomPropertyFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString , CollectionDataContract )       at System.Runtime.Serialization.Json.JsonCollectionDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract dataContract)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)       at ReadRemoteTestSetFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )       at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract dataContract)       at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)       at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)       at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)       at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)       at System.ServiceModel.Dispatcher.SingleBodyParameterDataContractMessageFormatter.ReadObject(Message message)       at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.DeserializeRequest(Message message, Object[] parameters)       at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters)       at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc rpc)       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc rpc)       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc rpc)       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc rpc)       at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)    </description><pubDate>Thu, 21 Jan 2016 01:44:19 -0500</pubDate><a10:updated>2016-01-25T21:47:32-05:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/1347.aspx</link></item><item><guid isPermaLink="false">messageId=2454</guid><author>David J (adam.sandman+support@inflectra.com)</author><title>&#xD;
Hi Damon  I would trim down the REST body to only have the fields that are needed, some of them ar</title><description>&#xD;
Hi Damon  I would trim down the REST body to only have the fields that are needed, some of them are read-only and others are NULL can be omitted:     {"CreationDate": "/Date(1432130413227-0700)/",    "CreatorId": 968,   "LastUpdateDate": "/Date(1432130443523-0700)/",   "Name": "RESTAPI",   "TestSetStatusId": 3  }     If that doesn't work, please  send us a help desk ticket  and we can debug for you.  Regards  Adam &#xD;
&#xD;
</description><pubDate>Mon, 25 Jan 2016 20:02:44 -0500</pubDate><a10:updated>2016-01-25T20:02:44-05:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/1347.aspx#reply2454</link></item><item><guid isPermaLink="false">messageId=2455</guid><author>D W (dkwang@directv.com)</author><title>&#xD;
Hello Adam,   Thank You for your suggestion.  I've stripped down the payload and it appears to be </title><description>&#xD;
Hello Adam,   Thank You for your suggestion.  I've stripped down the payload and it appears to be working for me.   Your response is much appreciated. &#xD;
&#xD;
</description><pubDate>Mon, 25 Jan 2016 21:47:32 -0500</pubDate><a10:updated>2016-01-25T21:47:32-05:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/1347.aspx#reply2455</link></item></channel></rss>