Requirement Folders
This chapter focuses on services for the requirement folders.
Get all requirement folders
A GET
to /requirement-folders
returns all the requirement folders that the client is allowed to read.
HTTP request
GET /api/rest/latest/requirement-folders?page=1&size=3 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which attributes of the returned entities should be sorted on (optional) |
|
which fields of the elements should be returned (optional) |
|
which type of the test case should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1438
{
"_embedded" : {
"requirement-folders" : [ {
"_type" : "requirement-folder",
"id" : 23,
"name" : "sample folder 1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/23"
}
}
}, {
"_type" : "requirement-folder",
"id" : 26,
"name" : "sample folder 2",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/26"
}
}
}, {
"_type" : "requirement-folder",
"id" : 31,
"name" : "sample folder 3",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/31"
}
}
} ]
},
"_links" : {
"first" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders?page=0&size=3"
},
"prev" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders?page=0&size=3"
},
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders?page=1&size=3"
},
"next" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders?page=2&size=3"
},
"last" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders?page=3&size=3"
}
},
"page" : {
"size" : 3,
"totalElements" : 10,
"totalPages" : 4,
"number" : 1
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements the client is allowed to read |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |
Create requirement folder
A POST
to /requirement-folders
creates a new requirement folder. The parent object and the name are required; refer to the complete reference of Get requirement folder for the other attributes.
HTTP request
POST /api/rest/latest/requirement-folders HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080
Content-Length: 223
{
"_type" : "requirement-folder",
"name" : "Requirement subfolder 1",
"custom_fields" : [ {
"code" : "cuf1",
"value" : "Cuf1 Value"
} ],
"parent" : {
"_type" : "requirement-folder",
"id" : 11
}
}
HTTP response
HTTP/1.1 201 Created
Content-Length: 1392
Content-Type: application/json;charset=UTF-8
{
"_type" : "requirement-folder",
"id" : 33,
"project" : {
"_type" : "project",
"id" : 14,
"name" : "Test Project 1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
}
}
},
"path" : "/Folder 1/Requirement subfolder 1",
"parent" : {
"_type" : "requirement-folder",
"id" : 11,
"name" : null,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/11"
}
}
},
"custom_fields" : [ {
"code" : "cuf1",
"label" : "Lib Cuf1",
"value" : "Cuf1 Value"
}, {
"code" : "cuf2",
"label" : "Lib Cuf2",
"value" : "true"
} ],
"name" : "Requirement subfolder 1",
"created_by" : "admin",
"created_on" : "2017-07-19T10:00:00.000+0000",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-19T10:00:00.000+0000",
"description" : null,
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/33"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
},
"content" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/33/content"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/33/attachments"
}
}
}
Get requirement folder
A GET
to /requirement-folders/{id}
returns the requirement folder with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the requirement folder |
HTTP request
GET /api/rest/latest/requirement-folders/356 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Length: 1298
Content-Type: application/json;charset=UTF-8
{
"_type" : "requirement-folder",
"id" : 356,
"project" : {
"_type" : "project",
"id" : 12,
"name" : "sample project",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/12"
}
}
},
"path" : "/sample project/sample parent folder/embedded folder",
"parent" : {
"_type" : "requirement-folder",
"id" : 34,
"name" : "sample parent folder",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/34"
}
}
},
"custom_fields" : [ ],
"name" : "embedded folder",
"created_by" : "User-1",
"created_on" : "2017-07-19T10:00:00.000+0000",
"last_modified_by" : "User-2",
"last_modified_on" : "2017-07-20T10:00:00.000+0000",
"description" : "<p>An embedded folder...</p>",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/356"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/12"
},
"content" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/356/content"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/356/attachments"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the entity |
|
|
the type of the entity |
|
|
name of the entity |
|
|
project of the entity |
|
|
the location of the entity (either a folder or the project if located at the root of the library) |
|
|
the path of the entity |
|
|
user that created the entity |
|
|
timestamp of the creation (ISO 8601) |
|
|
user that modified the entity the most recently |
|
|
timestamp of last modification (ISO 8601) |
|
|
description of that entity (html) |
|
|
the attachments of that entity |
|
|
related links |
|
|
the custom fields of this execution step |
Links
Relation | Description |
---|---|
|
the link of the folder |
|
the link of its project |
|
the link of its content |
|
the link of its attachments |
Modify requirement folder
A Patch
to /requirement-folders/{id}
modifies the requirement folder with the given id.
HTTP request
PATCH /api/rest/latest/requirement-folders/33 HTTP/1.1
Accept: application/json
Content-Length: 258
Content-Type: application/json
Host: localhost:8080
{
"_type" : "requirement-folder",
"name" : "Update - Requirement subfolder 1",
"description" : "Update - Description Requirement subfolder 1",
"custom_fields" : [ {
"code" : "cuf1",
"label" : "Lib Cuf1",
"value" : "Cuf1 new value"
} ]
}
HTTP response
HTTP/1.1 200 OK
Content-Length: 1452
Content-Type: application/json;charset=UTF-8
{
"_type" : "requirement-folder",
"id" : 33,
"project" : {
"_type" : "project",
"id" : 14,
"name" : "Test Project 1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
}
}
},
"path" : "/Folder 1/Update - Requirement subfolder 1",
"parent" : {
"_type" : "requirement-folder",
"id" : 11,
"name" : null,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/11"
}
}
},
"custom_fields" : [ {
"code" : "cuf1",
"label" : "Lib Cuf1",
"value" : "Cuf1 Value"
}, {
"code" : "cuf2",
"label" : "Lib Cuf2",
"value" : "true"
} ],
"name" : "Update - Requirement subfolder 1",
"created_by" : "admin",
"created_on" : "2017-07-19T10:00:00.000+0000",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-19T10:00:00.000+0000",
"description" : "Update - Description Requirement subfolder 1",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/33"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
},
"content" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/33/content"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/33/attachments"
}
}
}
Delete requirement folder
A DELETE
to /requirement-folders/{ids}
deletes one or several requirement folder with the given id(s). Remember that deleting a folder entails that its content is deleted as well !
Path parameters
Parameter | Description |
---|---|
|
the list of ids of the requirement folders |
HTTP request
DELETE /api/rest/latest/requirement-folders/21 HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080
Get requirement folder contents
A GET
to /requirement-folders/{id}/content
returns the content of the requirement folder with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the requirement-folder |
HTTP request
GET /api/rest/latest/requirement-folders/71/content?size=3&page=1 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which attributes of the returned entities should be sorted on (optional) |
|
which fields of the elements should be returned (optional) |
|
level of depth of the content that should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Length: 1344
Content-Type: application/json;charset=UTF-8
{
"_embedded" : {
"content" : [ {
"_type" : "requirement",
"id" : 78,
"name" : "embedded requirement 1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirements/78"
}
}
}, {
"_type" : "requirement",
"id" : 44,
"name" : "embedded requirement 2",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirements/44"
}
}
}, {
"_type" : "requirement-folder",
"id" : 12,
"name" : "embedded folder",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/12"
}
}
} ]
},
"_links" : {
"first" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/71/content?page=0&size=3"
},
"prev" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/71/content?page=0&size=3"
},
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/71/content?page=1&size=3"
},
"last" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-folders/71/content?page=1&size=3"
}
},
"page" : {
"size" : 3,
"totalElements" : 6,
"totalPages" : 2,
"number" : 1
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements the client is allowed to read |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |