title: Create Test using Xray REST API and link to Test Set
body: <p>I am trying to create a test using Xray REST API. At the time of creation, I am also trying to add the test case to a test set which already exists.</p>
  
  <p>This is my input json for the POST.</p>
  
  <pre><code>{
      "fields": {
         "project":
         {
            "key": "TEAM"
         },
         "summary": "Sum of two numbers-1",
         "description": "example of manual test-1",
         "issuetype": {
            "name": "Test"
         },
  
         "customfield_23240": { "value": "Manual" },             
         "customfield_23244": {
              "steps": [
                  {
                      "index": 0,
                      "step": "Step 1",
                      "data": "input Data 1",
                      "result": "Excepted result 1"
                  },
                  {
                      "index": 1,
                      "step": "Step 2",
                      "data": "input Data 2",
                      "result": "Excepted result 2"                     
                  },
                  {
                      "index": 2,
                      "step": "Step 3",
                      "data": "input Data 3",
                      "result": "Excepted result 3"                     
                  },
                  {
                      "index": 3,
                      "step": "Step 4",
                      "data": "input Data 4",
                      "result": "Excepted result 4"                     
                  }
              ]
          },
          "customfield_23246": {
              "set": [
                  "TEAM-12"
              ]
          }   
     }
  }
  </code></pre>
  
  <p>I have double-checked the customfield ids and they are correct.</p>
  
  <p>This is the command I am running</p>
  
  <pre><code>curl -H "Content-Type: application/json" -X POST --data @test-1.json  -u user:pwd https://myserver/rest/api/2/issue
  </code></pre>
  
  <p>But I am getting http 500 error.</p>
  
  <pre><code>{"errorMessages":["Internal server error"],"errors":{}}
  </code></pre>
  
  <p>Am I doing something wrong or am I doing something which is not supported by API. It is not clear to me from Xray documentation.</p>