Requirement Versions

This chapter focuses on services for the requirement versions.

Get requirement version

A GET to /requirement-versions/{id} returns the requirement version with the given id.

Path parameters

Table 1. /api/rest/latest/requirement-versions/{id}
Parameter Description

id

the id of the requirement version

HTTP request

GET /api/rest/latest/requirement-versions/3 HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2016

{
  "_type" : "requirement-version",
  "id" : 3,
  "name" : "sample requirement",
  "reference" : "SAMP_REQ_VER",
  "version_number" : 2,
  "requirement" : {
    "_type" : "requirement",
    "id" : 64,
    "name" : "sample requirement",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/requirements/64"
      }
    }
  },
  "created_by" : "User-1",
  "created_on" : "2017-07-19T10:00:00.000+00:00",
  "last_modified_by" : "User-2",
  "last_modified_on" : "2017-07-20T10:00:00.000+00:00",
  "criticality" : "CRITICAL",
  "category" : {
    "code" : "CAT_PERFORMANCE"
  },
  "status" : "APPROVED",
  "description" : "<p>Approved performance requirement-version</p>",
  "custom_fields" : [ {
    "code" : "CUF1",
    "label" : "Cuf One",
    "value" : "value_1"
  }, {
    "code" : "CUF2",
    "label" : "Cuf Two",
    "value" : "value_2"
  } ],
  "verifying_test_cases" : [ {
    "_type" : "test-case",
    "id" : 4,
    "name" : "verifying test case 1",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/4"
      }
    }
  }, {
    "_type" : "scripted-test-case",
    "id" : 9,
    "name" : "verifying scripted test case 2",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/9"
      }
    }
  }, {
    "_type" : "keyword-test-case",
    "id" : 14,
    "name" : "verifying keyword test case 3",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/14"
      }
    }
  } ],
  "attachments" : [ ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-versions/3"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/85"
    },
    "requirement" : {
      "href" : "http://localhost:8080/api/rest/latest/requirements/64"
    },
    "attachments" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-versions/3/attachments"
    }
  }
}

Response fields

Path Type Description

id

Number

the id of the requirement version

_type

String

the type of the entity

name

String

the name of the requirement version

reference

String

the reference of the requirement version

version_number

Number

the version number

requirement

Object

the requirement of this requirement version

created_by

String

user that created the entity

created_on

String

timestamp of the creation (ISO 8601)

last_modified_by

String

user that modified the entity the most recently

last_modified_on

String

timestamp of last modification (ISO 8601)

criticality

String

the criticality of this requirement version

category

Object

the category of this requirement version

status

String

the status of this requirement version

description

String

the description of this requirement version

verifying_test_cases

Array

the test cases which cover this requirement version

custom_fields

Array

the custom fields of this requirement version

attachments

Array

the attachments of this requirement version

_links

Object

related links

Relation Description

self

link to this requirement version

project

link to the project this requirement version belongs to

requirement

link to the requirement this requirement version belongs to

attachments

link to the attachments this requirement version owns

Create requirement version

A POST to /requirement-versions creates a new requirement version.

Path parameters

Table 1. /api/rest/latest/requirement-versions/{id}
Parameter Description

id

the id of the requirement for which you create a new version

HTTP request

POST /api/rest/latest/requirement-versions/64?req_link=false&tc_req_link=false HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

req_link

true if you want to copy the links between the non-obsolete requirement versions (optional)

tc_req_link

true if you want to copy the associated test cases in the new requirement version (optional)

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2016

{
  "_type" : "requirement-version",
  "id" : 3,
  "name" : "sample requirement",
  "reference" : "SAMP_REQ_VER",
  "version_number" : 2,
  "requirement" : {
    "_type" : "requirement",
    "id" : 64,
    "name" : "sample requirement",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/requirements/64"
      }
    }
  },
  "created_by" : "User-1",
  "created_on" : "2017-07-19T10:00:00.000+00:00",
  "last_modified_by" : "User-2",
  "last_modified_on" : "2017-07-20T10:00:00.000+00:00",
  "criticality" : "CRITICAL",
  "category" : {
    "code" : "CAT_PERFORMANCE"
  },
  "status" : "APPROVED",
  "description" : "<p>Approved performance requirement-version</p>",
  "custom_fields" : [ {
    "code" : "CUF1",
    "label" : "Cuf One",
    "value" : "value_1"
  }, {
    "code" : "CUF2",
    "label" : "Cuf Two",
    "value" : "value_2"
  } ],
  "verifying_test_cases" : [ {
    "_type" : "test-case",
    "id" : 4,
    "name" : "verifying test case 1",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/4"
      }
    }
  }, {
    "_type" : "scripted-test-case",
    "id" : 9,
    "name" : "verifying scripted test case 2",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/9"
      }
    }
  }, {
    "_type" : "keyword-test-case",
    "id" : 14,
    "name" : "verifying keyword test case 3",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/14"
      }
    }
  } ],
  "attachments" : [ ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-versions/3"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/85"
    },
    "requirement" : {
      "href" : "http://localhost:8080/api/rest/latest/requirements/64"
    },
    "attachments" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-versions/3/attachments"
    }
  }
}

Response fields

Path Type Description

id

Number

the id of the requirement for which you create a new version

_type

String

the type of the entity

name

String

the name of the requirement version

reference

String

the reference of the requirement version

version_number

Number

the version number

requirement

Object

the requirement of this requirement version

created_by

String

user that created the entity

created_on

String

timestamp of the creation (ISO 8601)

last_modified_by

String

user that modified the entity the most recently

last_modified_on

String

timestamp of last modification (ISO 8601)

criticality

String

the criticality of this requirement version

category

Object

the category of this requirement version

status

String

the status of this requirement version

description

String

the description of this requirement version

custom_fields

Array

the custom fields of this requirement version

verifying_test_cases

Array

the test cases which cover this requirement version

attachments

Array

the attachments of this requirement version

_links

Object

related links

Relation Description

self

link to this requirement version

project

link to the project this requirement version belongs to

requirement

link to the requirement this requirement version belongs to

attachments

link to the attachments this requirement version owns

Modify requirement version

A PATCH to /requirement-versions/{id} modifies the requirement version with the given id. The properties that you can modify are the name, reference, description, category, criticality,status and custom fields.

Path parameters

Table 1. /api/rest/latest/requirement-versions/{id}
Parameter Description

id

the id of the requirement version

HTTP request

PATCH /api/rest/latest/requirement-versions/3 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 472
Host: localhost:8080

{
  "_type" : "requirement-version",
  "name" : "new requirement version after modify",
  "reference" : "SAMP_REQ_VER",
  "criticality" : "MAJOR",
  "category" : {
    "code" : "CAT_USER_STORY"
  },
  "status" : "APPROVED",
  "description" : "<p>Comment after modify</p>",
  "custom_fields" : [ {
    "code" : "cuf_txt_note1",
    "value" : "Star Trek style welcomed but not mandatory"
  }, {
    "code" : "cuf_txt_note2",
    "value" : "may the force be with you"
  } ]
}

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

Request fields

Path Type Description

_type

String

the type of the entity

name

String

the name of the requirement version

reference

String

the reference of the requirement version

criticality

String

the criticality of this requirement version

category

Object

the category of this requirement version

status

String

the status of this requirement version

description

String

the description of this requirement version

custom_fields

Array

the custom fields of this requirement version

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2099

{
  "_type" : "requirement-version",
  "id" : 3,
  "name" : "new requirement version after modify",
  "reference" : "SAMP_REQ_VER",
  "version_number" : 2,
  "requirement" : {
    "_type" : "requirement",
    "id" : 64,
    "name" : "new requirement version after modify",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/requirements/64"
      }
    }
  },
  "created_by" : "User-1",
  "created_on" : "2017-07-19T10:00:00.000+00:00",
  "last_modified_by" : "User-2",
  "last_modified_on" : "2017-07-20T10:00:00.000+00:00",
  "criticality" : "MAJOR",
  "category" : {
    "code" : "CAT_USER_STORY"
  },
  "status" : "APPROVED",
  "description" : "<p>Comment after modify</p>",
  "custom_fields" : [ {
    "code" : "cuf_txt_note1",
    "label" : "Cuf One",
    "value" : "Star Trek style welcomed but not mandatory"
  }, {
    "code" : "cuf_txt_note2",
    "label" : "Cuf Two",
    "value" : "may the force be with you"
  } ],
  "verifying_test_cases" : [ {
    "_type" : "test-case",
    "id" : 4,
    "name" : "verifying test case 1",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/4"
      }
    }
  }, {
    "_type" : "scripted-test-case",
    "id" : 9,
    "name" : "verifying scripted test case 2",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/9"
      }
    }
  }, {
    "_type" : "keyword-test-case",
    "id" : 14,
    "name" : "verifying keyword test case 3",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/14"
      }
    }
  } ],
  "attachments" : [ ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-versions/3"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/85"
    },
    "requirement" : {
      "href" : "http://localhost:8080/api/rest/latest/requirements/64"
    },
    "attachments" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-versions/3/attachments"
    }
  }
}

Response fields

Path Type Description

id

Number

the id of the requirement version

_type

String

the type of the entity

name

String

the name of the requirement version

reference

String

the reference of the requirement version

version_number

Number

the version number

requirement

Object

the requirement of this requirement version

created_by

String

user that created the entity

created_on

String

timestamp of the creation (ISO 8601)

last_modified_by

String

user that modified the entity the most recently

last_modified_on

String

timestamp of last modification (ISO 8601)

criticality

String

the criticality of this requirement version

category

Object

the category of this requirement version

status

String

the status of this requirement version

description

String

the description of this requirement version

custom_fields

Array

the custom fields of this requirement version

verifying_test_cases

Array

the test cases which cover this requirement version

attachments

Array

the attachments of this requirement version

_links

Object

related links

Relation Description

self

link to this requirement version

project

link to the project this requirement version belongs to

requirement

link to the requirement this requirement version belongs to

attachments

link to the attachments this requirement version owns

A POST to /requirement-versions/{id}/coverages/{testCaseIds} link the test cases to the requirement version.

Table 1. /api/rest/latest/requirement-versions/{id}/coverages/{testCaseIds}
Parameter Description

id

the id of the requirement version

testCaseIds

the ids of the test cases to associate

POST /api/rest/latest/requirement-versions/658/coverages/350,351,352 HTTP/1.1
Accept: application/json
Host: localhost:8080
Parameter Description

fields

which fields of the elements should be returned (optional)

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1936

{
  "_type" : "requirement-version",
  "id" : 658,
  "name" : "User friendly interface",
  "reference" : "UX-5",
  "version_number" : 1,
  "requirement" : {
    "_type" : "requirement",
    "id" : 64,
    "name" : "User friendly interface",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/requirements/64"
      }
    }
  },
  "created_by" : "admin",
  "created_on" : "2017-06-15T10:00:00.000+00:00",
  "last_modified_by" : "admin",
  "last_modified_on" : "2017-06-15T10:00:00.000+00:00",
  "criticality" : "MAJOR",
  "category" : {
    "code" : "CAT_ERGONOMIC"
  },
  "status" : "WORK_IN_PROGRESS",
  "description" : "<p>User interface is minimalist and easy to use.</p>",
  "custom_fields" : [ {
    "code" : "AUTOMATED",
    "label" : "test_is_automated",
    "value" : "false"
  } ],
  "verifying_test_cases" : [ {
    "_type" : "test-case",
    "id" : 350,
    "name" : "Verify click number",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/350"
      }
    }
  }, {
    "_type" : "test-case",
    "id" : 351,
    "name" : "Verify element number",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/351"
      }
    }
  }, {
    "_type" : "test-case",
    "id" : 352,
    "name" : "Verify page space",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/352"
      }
    }
  } ],
  "attachments" : [ ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-versions/658"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/85"
    },
    "requirement" : {
      "href" : "http://localhost:8080/api/rest/latest/requirements/64"
    },
    "attachments" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-versions/658/attachments"
    }
  }
}
Path Type Description

id

Number

the id of the requirement version

_type

String

the type of the entity

name

String

the name of the requirement version

reference

String

the reference of the requirement version

version_number

Number

the version number

requirement

Object

the requirement of this requirement version

created_by

String

user that created the entity

created_on

String

timestamp of the creation (ISO 8601)

last_modified_by

String

user that modified the entity the most recently

last_modified_on

String

timestamp of last modification (ISO 8601)

criticality

String

the criticality of this requirement version

category

Object

the category of this requirement version

status

String

the status of this requirement version

description

String

the description of this requirement version

custom_fields

Array

the custom fields of this requirement version

verifying_test_cases

Array

the test cases which cover this requirement version

attachments

Array

the attachments of this requirement version

_links

Object

related links

Relation Description

self

link to this requirement version

project

link to the project this requirement version belongs to

requirement

link to the requirement this requirement version belongs to

attachments

link to the attachments this requirement version owns

A DELETE to /requirement-versions/{id}/coverages/{testCaseIds} unlink the test cases from the requirement version.

Table 1. /api/rest/latest/requirement-versions/{id}/coverages/{testCaseIds}
Parameter Description

id

the id of the requirement version

testCaseIds

the ids of the test cases to disassociate

DELETE /api/rest/latest/requirement-versions/543/coverages/350,351 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080