Milestones

This chapter focuses on milestones. Milestones allow you to “version” your test repository and to view only the objects (requirements, test cases and campaigns) associated with them. With milestones, you can in particular organize your object libraries by version, create a new version of the repository from an existing version, synchronize two versions …​

Activate / deactivate milestones mode

A POST to /milestones/activate activate / deactivate milestones mode, according to the value sent in the parameter.

HTTP request

POST /api/rest/latest/milestones/activate?enabled=true HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

enabled

takes the values true/false to activate/deactivate the milestone mode.

HTTP response

HTTP/1.1 204 No Content

Get all milestones

A GET to /milestones returns all the milestones that the user is allowed to read.

HTTP request

GET /api/rest/latest/milestones HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

page

number of the page to retrieve (optional)

size

size of the page to retrieve (optional)

sort

which attributes of the returned entities should be sorted on (optional)

fields

which fields of the elements should be returned (optional)

type

which type of the element should be returned (optional)

HTTP response

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

{
  "_embedded" : {
    "milestones" : [ {
      "_type" : "milestone",
      "id" : 11,
      "label" : "Milestone 1",
      "status" : "PLANNED",
      "end_date" : "2020-03-19T00:23:45.000+00:00",
      "range" : "GLOBAL",
      "description" : "example of milestone creation",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/milestones/11"
        }
      }
    }, {
      "_type" : "milestone",
      "id" : 12,
      "label" : "Milestone 2",
      "status" : "PLANNED",
      "end_date" : "2020-03-19T00:23:45.000+00:00",
      "range" : "GLOBAL",
      "description" : "example of milestone creation number 2 ",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/milestones/12"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/milestones?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 2,
    "totalPages" : 1,
    "number" : 0
  }
}

Response fields

Path Type Description

_embedded.milestones

Array

the list of elements for that page

page.size

Number

the page size for that query

page.totalElements

Number

total number of elements

page.totalPages

Number

how many pages can be browsed

page.number

Number

the page number

_links

Object

related links

Relation Description

first

link to the first page (optional)

prev

link to the previous page (optional)

self

link to this page

next

link to the next page (optional)

last

link to the last page (optional)

Get milestone

A GET to /milestones/{id} returns the milestone with the given id.

Path parameters

Table 1. /api/rest/latest/milestones/{id}
Parameter Description

id

the id of the milestone

HTTP request

GET /api/rest/latest/milestones/11 HTTP/1.1
Accept: application/json
Host: localhost:8080

HTTP response

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

{
  "_type" : "milestone",
  "id" : 11,
  "label" : "Milestone 1",
  "status" : "PLANNED",
  "end_date" : "2020-03-19T00:23:45.000+00:00",
  "range" : "GLOBAL",
  "description" : "example of milestone creation",
  "created_by" : "admin",
  "created_on" : "2020-04-06T10:00:00.000+00:00",
  "last_modified_by" : "admin",
  "last_modified_on" : "2020-04-06T10:00:00.000+00:00",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/milestones/11"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the milestone

label

String

the label of the milestone

description

String

the description of the milestone

status

String

the status of the milestone

end_date

String

due date of the milestone

range

String

range of the milestone

created_by

String

user who created the entity

created_on

String

timestamp of the creation (ISO 8601)

last_modified_by

String

user who modified the entity the most recently

last_modified_on

String

timestamp of last modification (ISO 8601)

_links

Object

related links

Relation Description

self

link to this milestone

Create milestone

A POST to /milestones creates a new milestone.

HTTP request

POST /api/rest/latest/milestones HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 177
Host: localhost:8080

{
  "_type" : "milestone",
  "label" : "Milestone 1",
  "description" : "example of milestone creation",
  "end_date" : "2020-03-19T22:00:00.000+00:00",
  "status" : "PLANNED"
}

Request fields

Path Type Description

_type

String

the type of the entity (mandatory)

label

String

the label of the milestone (mandatory)

description

String

the description of the milestone

status

String

the status of the milestone.

end_date

String

due date of the milestone (mandatory)

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 486

{
  "_type" : "milestone",
  "id" : 11,
  "label" : "Milestone 1",
  "status" : "PLANNED",
  "end_date" : "2020-03-19T00:23:45.000+00:00",
  "range" : "GLOBAL",
  "description" : "example of milestone creation",
  "created_by" : "admin",
  "created_on" : "2020-04-06T10:00:00.000+00:00",
  "last_modified_by" : "admin",
  "last_modified_on" : "2020-04-06T10:00:00.000+00:00",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/milestones/11"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the milestone

label

String

the label of the milestone

description

String

the description of the milestone

status

String

the status of the milestone

end_date

String

due date of the milestone

range

String

range of the milestone

created_by

String

user who created the entity

created_on

String

timestamp of the creation (ISO 8601)

last_modified_by

String

user who modified the entity the most recently

last_modified_on

String

timestamp of last modification (ISO 8601)

_links

Object

related links

Relation Description

self

link to this milestone

Modify milestone

A PATCH to /milestones/{id} modifies the milestone with the given id.

HTTP request

PATCH /api/rest/latest/milestones/11 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 203
Host: localhost:8080

{
  "_type" : "milestone",
  "label" : "Milestone 1",
  "description" : "example of milestone updating",
  "end_date" : "2020-03-19T22:00:00.000+00:00",
  "status" : "PLANNED",
  "range" : "RESTRICTED"
}

Path parameters

Table 1. /api/rest/latest/milestones/{id}
Parameter Description

id

the id of the milestone

Request fields

Path Type Description

_type

String

the type of the entity (mandatory)

label

String

the label of the milestone

description

String

the description of the milestone

status

String

the status of the milestone.

end_date

String

due date of the milestone

range

String

range of the milestone

HTTP response

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

{
  "_type" : "milestone",
  "id" : 11,
  "label" : "Milestone 1",
  "status" : "PLANNED",
  "end_date" : "2020-03-19T00:23:45.000+00:00",
  "range" : "RESTRICTED",
  "description" : "example of milestone updating",
  "created_by" : "admin",
  "created_on" : "2020-04-06T10:00:00.000+00:00",
  "last_modified_by" : "admin",
  "last_modified_on" : "2020-04-06T10:00:00.000+00:00",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/milestones/11"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the milestone

label

String

the label of the milestone

description

String

the description of the milestone

status

String

the status of the milestone

end_date

String

due date of the milestone

range

String

range of the milestone

created_by

String

user who created the entity

created_on

String

timestamp of the creation (ISO 8601)

last_modified_by

String

user who modified the entity the most recently

last_modified_on

String

timestamp of last modification (ISO 8601)

_links

Object

related links

Relation Description

self

link to this milestone

Delete milestone

A DELETE to /milestones/{ids} deletes one or several milestone(s) with the given id(s).

Path parameters

Table 1. /api/rest/latest/milestones/{ids}
Parameter Description

ids

the list of ids of the milestones

HTTP request

DELETE /api/rest/latest/milestones/11,12 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080

HTTP response

HTTP/1.1 204 No Content