Add a Related Record

The various details of how to add a related record is explained in this section. You cannot add a reverse relationship. Also, perspective for child record attribute is not supported.

HTTP Method

POST

Endpoint URL

See Endpoint.

Resource

records/{parentRepositoryName}/relRecord

Request Parameters

Specify either of the following parameters:

Name Description Type Data Type
repositoryName Specify the repository name.

This field is Mandatory.

path string
workItemId Specify the work item ID. query string

Request Model

Media Type: application/json.

{
  "process": false,
  "validate": false,
  "workItemId": "string",
  "perspectiveName": "string",
  "record": {
    "productId": "string",
    "productIdExt": "string",
    "productKeyId": "string",
    "version": "string",
    "state": "string",
    "key": 0,
    "attributes": [
      {
        "name": "string",
        "value": "string",
        "displayName": "string",
        "multivalues": [
          {}
        ],
        "type": 0,
        "id": 0,
        "multivalue": false
      }
    ],
    "repositoryName": "string",
    "relationships": {
      "relationshipAttributes": [
        {
          "name": "string",
          "value": "string",
          "displayName": "string",
          "multivalues": [
            {}
          ],
          "type": 0,
          "id": 0,
          "multivalue": false
        }
      ],
      "targetRecord": {}
    },
    "deleted": false
  }
}

Response Model

The server sends response 200 OK with HTTP status code for each successfully completed request. The success response format is as follows:

{
  "responseMessages": [
    {
      "code": "string",
      "message": "string",
      "type": "string"
    }
  ],
  "records": [
    {
      "repositoryName": "string",
      "productId": "string",
      "productIdExt": "string",
      "productKeyId": "string",
      "responseAttributes": [
        {
          "attributeName": "string",
          "attributeDisplayName": "string",
          "values": [
            "string"
          ],
          "errorCode": "string",
          "errorMessage": "string",
          "errorType": "string"
        }
      ],
      "responseRelationships": [
        {
          "relationshipName": "string",
          "sourceRepositoryName": "string",
          "targetRepositoryName": "string",
          "recordId": "string",
          "recordIdExt": "string",
          "productKeyId": "string",
          "responseAttributes": [
            {
              "attributeName": "string",
              "attributeDisplayName": "string",
              "values": [
                "string"
              ],
              "errorCode": "string",
              "errorMessage": "string",
              "errorType": "string"
            }
          ]
        }
      ]
    }
  ],
  "success": true
}

If response is unsuccessful, either of the following error code is displayed:

  • 400 Bad Request
  • 404 Not Found
  • 500 Internal Server Error

For error code response, see Error Handling .