Synchronisations

This chapter focuses on synchronisations.

Get all synchronisations by project

A GET to /projects/{id}/synchronisations returns all the synchronisations that the client is allowed to read.

HTTP request

GET /api/rest/latest/projects/14/synchronisations?page=1&size=2 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)

HTTP response

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

{
  "_embedded" : {
    "synchronisations" : [ {
      "_type" : "synchronisation",
      "id" : 1,
      "name" : "tata",
      "server_name" : "BugtrackerDemo",
      "server_id" : 3,
      "select_type" : "BOARD",
      "select_value" : "Tableau XS",
      "additional_JQL" : "",
      "synchronisation_path" : "/Test Project-1/demo2",
      "restrain_to_active_sprint" : false,
      "last_sync_date" : "2020/03/27 10:20",
      "last_successful_sync_date" : "2020/03/27 10:20",
      "last_status" : "Passed",
      "status" : "Passed",
      "activated" : false,
      "project_id" : 14,
      "project_name" : "Test Project-1",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/synchronisations/1"
        }
      }
    }, {
      "_type" : "synchronisation",
      "id" : 2,
      "name" : "toto",
      "server_name" : "BugtrackerDemo2",
      "server_id" : 3,
      "select_type" : "BOARD",
      "select_value" : "Tableau XS",
      "additional_JQL" : "",
      "synchronisation_path" : "/Test Project-1/demo2",
      "restrain_to_active_sprint" : false,
      "last_sync_date" : "2020/03/27 10:20",
      "last_successful_sync_date" : "2020/03/27 10:20",
      "last_status" : "Passed",
      "status" : "Passed",
      "activated" : false,
      "project_id" : 14,
      "project_name" : "Test Project-1",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/synchronisations/2"
        }
      }
    } ]
  },
  "_links" : {
    "first" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/synchronisations?page=0&size=2"
    },
    "prev" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/synchronisations?page=0&size=2"
    },
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/synchronisations?page=1&size=2"
    },
    "last" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/synchronisations?page=1&size=2"
    }
  },
  "page" : {
    "size" : 2,
    "totalElements" : 4,
    "totalPages" : 2,
    "number" : 1
  }
}

Response fields

Path Type Description

_embedded.synchronisations

Array

the list of elements for that page

page.size

Number

the page size for that query

page.totalElements

Number

total number of elements the client is allowed to read

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 synchronisation

A GET to /synchronisations/{id} returns the synchronisation with the given id.

Path parameters

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

id

the id of the synchronisation

HTTP request

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

HTTP response

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

{
  "_type" : "synchronisation",
  "id" : 3,
  "name" : "tata",
  "server_name" : "BugtrackerDemo3",
  "server_id" : 123,
  "select_type" : "BOARD",
  "select_value" : "Tableau XS",
  "additional_JQL" : "",
  "synchronisation_path" : "/Test Project-1/demo2",
  "restrain_to_active_sprint" : false,
  "last_sync_date" : "2020/03/27 10:20",
  "last_successful_sync_date" : "2020/03/27 10:20",
  "last_status" : "Passed",
  "status" : "Passed",
  "activated" : false,
  "project_id" : 14,
  "project_name" : "Test Project-1",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/synchronisations/3"
    }
  }
}

Response fields

Path Type Description

id

Number

the id of the entity

_type

String

the type of the entity

server_name

String

name of the bug-tracker use for the current synchronisation

server_id

Number

id of the bug-tracker use for the current synchronisation

name

String

name of the synchronisation

select_type

String

select type

select_value

String

select value

additional_JQL

String

JQL script

synchronisation_path

String

directory where the requirement synchronize is save in Squash TM

restrain_to_active_sprint

Boolean

restrain to active sprint

last_sync_date

String

last synchronisation date

last_successful_sync_date

String

last successful synchronisation date

last_status

String

last status

status

String

status

activated

Boolean

enable/desable synchronisation

project_id

Number

id of the project where the current synchronisation is configured

project_name

String

name of the project where the current synchronisation is configured

_links

Object

related links

Relation Description

self

link to this synchronisation

Create synchronisation

A POST to /projects/{id}/synchronisations creates a new synchronisation.

HTTP request

POST /api/rest/latest/projects/14/synchronisations HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 183
Host: localhost:8080

{
  "name" : "demoSynchro",
  "synchronisation_path" : "/Test Project-1/demo2",
  "select_type" : "BOARD",
  "select_value" : "Tableau XS",
  "server_id" : 14,
  "activated" : false
}

Request fields

Path Type Description

name

String

name of the synchronisation (mandatory)

synchronisation_path

String

directory where the synchronized requirements are saved in Squash TM (mandatory)

select_type

String

select type (mandatory)

select_value

String

select value (mandatory)

server_id

Number

id of the bug tracker use for the current synchronisation (mandatory)

activated

Boolean

whether the synchronisation is activated

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

HTTP response

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

{
  "_type" : "synchronisation",
  "id" : 4,
  "name" : "demoSynchro",
  "server_name" : "BugtrackerDemo3",
  "server_id" : 14,
  "select_type" : "BOARD",
  "select_value" : "Tableau XS",
  "additional_JQL" : "",
  "synchronisation_path" : "/Test Project-1/demo2",
  "restrain_to_active_sprint" : false,
  "last_sync_date" : "2020/03/27 10:20",
  "last_successful_sync_date" : "2020/03/27 10:20",
  "last_status" : "Passed",
  "status" : "Passed",
  "activated" : false,
  "project_id" : 14,
  "project_name" : "Test Project-1",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/synchronisations/4"
    }
  }
}

Response fields

Path Type Description

id

Number

the id of the entity

_type

String

the type of the entity

server_name

String

name of the bug tracker used for the current synchronisation

server_id

Number

id of the bug tracker used for the current synchronisation

name

String

name of the synchronisation

select_type

String

select type

select_value

String

select value

additional_JQL

String

JQL script

synchronisation_path

String

directory where the synchronized requirements are saved in Squash TM

restrain_to_active_sprint

Boolean

restrain to active sprint

last_sync_date

String

last synchronisation date

last_successful_sync_date

String

last successful synchronisation date

last_status

String

last status

status

String

status

activated

Boolean

enable/disable synchronisation

project_id

Number

id of the project where the current synchronisation is configured

project_name

String

name of the project where the current synchronisation is configured

_links

Object

related links

Relation Description

self

link to this synchronisation

Modify synchronisation

A PATCH to /synchronisations/{id} modifies synchronisation with the given id. Only name, select value and additional JQL which can be modified

HTTP request

PATCH /api/rest/latest/synchronisations/4 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 92
Host: localhost:8080

{
  "name" : "UpdateDemoSynchro",
  "select_value" : "tab Update",
  "additional_JQL" : ""
}

Path parameters

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

id

the id of the synchronisation

HTTP response

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

{
  "_type" : "synchronisation",
  "id" : 4,
  "name" : "UpdateDemoSynchro",
  "server_name" : "BugtrackerDemo3",
  "server_id" : 14,
  "select_type" : "BOARD",
  "select_value" : "tab Update",
  "additional_JQL" : "",
  "synchronisation_path" : "/Test Project-1/demo2",
  "restrain_to_active_sprint" : false,
  "last_sync_date" : "2020/03/27 10:20",
  "last_successful_sync_date" : "2020/03/27 10:20",
  "last_status" : "Passed",
  "status" : "Passed",
  "activated" : false,
  "project_id" : 14,
  "project_name" : "Test Project-1",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/synchronisations/4"
    }
  }
}

Activate/deactivate synchronisation

A PATCH to /synchronisations/{id} modifies the name of the synchronisation with the given id.

HTTP request

PATCH /api/rest/latest/synchronisations/4/activate?enabled=true HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080

Path parameters

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

id

the id of the synchronisation

HTTP response

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

{
  "_type" : "synchronisation",
  "id" : 4,
  "name" : "DemoSynchro",
  "server_name" : "BugtrackerDemo3",
  "server_id" : 14,
  "select_type" : "BOARD",
  "select_value" : "Tableau",
  "additional_JQL" : "",
  "synchronisation_path" : "/Test Project-1/demo2",
  "restrain_to_active_sprint" : false,
  "last_sync_date" : "2020/05/25 10:20",
  "last_successful_sync_date" : "2020/05/25 10:20",
  "last_status" : "Passed",
  "status" : "Passed",
  "activated" : true,
  "project_id" : 14,
  "project_name" : "Test Project-1",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/synchronisations/4"
    }
  }
}

Launch Synchronisation

A GET to /synchronisations/{id}/synchronize launch synchronisation project

HTTP request

GET /api/rest/latest/synchronisations/4/synchronize HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080

Path parameters

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

id

the id of the synchronisation

HTTP response

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

{
  "_type" : "synchronisation",
  "id" : 4,
  "name" : "demoSynchro",
  "server_name" : "BugtrackerDemo3",
  "server_id" : 14,
  "select_type" : "BOARD",
  "select_value" : "Tableau XS",
  "additional_JQL" : "",
  "synchronisation_path" : "/Test Project-1/demo2",
  "restrain_to_active_sprint" : false,
  "last_sync_date" : "2020/03/27 10:20",
  "last_successful_sync_date" : "2020/03/27 10:20",
  "last_status" : "Passed",
  "status" : "Passed",
  "activated" : true,
  "project_id" : 14,
  "project_name" : "Test Project-1",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/synchronisations/4"
    }
  }
}

Delete synchronisation

A DELETE to /synchronisations/{id} deletes the synchronisation with the given id.

HTTP request

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

Path parameters

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

id

the id of the synchronisation

HTTP response

HTTP/1.1 204 No Content