Bug Trackers
This chapter focuses on services for the bug trackers.
Get all bug trackers
A GET
to /bug-trackers
returns all the bug trackers.
HTTP request
GET /api/rest/latest/bug-trackers 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 element should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1107
{
"_embedded" : {
"bug-trackers" : [ {
"_type" : "bug-tracker",
"id" : 1,
"name" : "bugtracker1",
"url" : "https://xsquash.atlassian.net/",
"kind" : "jira.xsquash",
"iframe_friendly" : false,
"authentication_policy" : "USER",
"authentication_protocol" : "BASIC_AUTH",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/1"
}
}
}, {
"_type" : "bug-tracker",
"id" : 2,
"name" : "bugtracker2",
"url" : "https://xsquash.atlassian.net/",
"kind" : "jira.xsquash",
"iframe_friendly" : false,
"authentication_policy" : "APP_LEVEL",
"authentication_protocol" : "OAUTH_1A",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/2"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements |
|
|
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) |
Get bug tracker
A GET
to /bug-trackers/{id}
returns the bug tracker with the given id.
HTTP request
GET /api/rest/latest/bug-trackers/3 HTTP/1.1
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
the id of the bug-tracker |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 325
{
"_type" : "bug-tracker",
"id" : 3,
"name" : "bugtracker3",
"url" : "url3",
"kind" : "kind3",
"iframe_friendly" : false,
"authentication_policy" : "USER",
"authentication_protocol" : "BASIC_AUTH",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/3"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the entity |
|
|
the type of the entity |
|
|
name of the bug-tracker |
|
|
url of the bugtracker |
|
|
kind of the bugtracker : mantis or jira |
|
|
the bugtracker displays in iframe |
|
|
authentication Policy : USER or APP |
|
|
Protocol of authentification: Basic Auth or Oauth 1 |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this bugtracker |
Create bug tracker
A POST
to /bug-trackers
creates a new bug tracker.
HTTP request
POST /api/rest/latest/bug-trackers HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 240
Host: localhost:8080
{
"_type" : "bug-tracker",
"name" : "createdBugtracker",
"url" : "https://squash.atlassian.net/",
"kind" : "jira.xsquash",
"iframe_friendly" : false,
"authentication_policy" : "USER",
"authentication_protocol" : "BASIC_AUTH"
}
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the name of bug tracker |
|
|
the url of the bug tracker |
|
|
the kind of the bug tracker |
|
|
the description of the bug tracker |
|
|
the authentication Policy of the bug tracker : 'USER' or 'APP_LEVEL' |
|
|
the authentication Protocol of the bug tracker: 'BASIC_AUTH' or 'OAUTH_A1' |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 363
{
"_type" : "bug-tracker",
"id" : 4,
"name" : "createdBugtracker",
"url" : "https://squash.atlassian.net/",
"kind" : "jira.xsquash",
"iframe_friendly" : false,
"authentication_policy" : "USER",
"authentication_protocol" : "BASIC_AUTH",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/4"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the id of the bug tracker |
|
|
the name of the bug tracker |
|
|
the url of the bug tracker |
|
|
the kind of the bug tracker |
|
|
the description of the bug tracker |
|
|
the authentication Policy of the bug tracker: 'USER' or 'APP_LEVEL' |
|
|
the authentication Protocol of the bug tracker: 'BASIC_AUTH' or 'OAUTH_A1' |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this bug tracker |
Modify bug tracker
A PATCH
to /bug-trackers/{id}
modifies the bug trackers with the given id.
HTTP request
PATCH /api/rest/latest/bug-trackers/4 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 240
Host: localhost:8080
{
"_type" : "bug-tracker",
"name" : "updatedBugtracker",
"url" : "https://squash.atlassian.net/",
"kind" : "jira.xsquash",
"iframe_friendly" : false,
"authentication_policy" : "USER",
"authentication_protocol" : "BASIC_AUTH"
}
Path parameters
Parameter | Description |
---|---|
|
the id of the bugtracker you want to update |
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the name of bug tracker |
|
|
the url of the bug tracker |
|
|
the kind of the bug tracker |
|
|
the description of the bug tracker |
|
|
the authentication Policy of the bug tracker: 'USER' or 'APP_LEVEL' |
|
|
the authentication Protocol of the bug tracker: 'BASIC_AUTH' or 'OAUTH_A1' |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 363
{
"_type" : "bug-tracker",
"id" : 4,
"name" : "updatedBugtracker",
"url" : "https://squash.atlassian.net/",
"kind" : "jira.xsquash",
"iframe_friendly" : false,
"authentication_policy" : "USER",
"authentication_protocol" : "BASIC_AUTH",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/4"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the id of the bugtracker |
|
|
the name of the bugtracker |
|
|
the url of the bugtracker |
|
|
the kind of the bugtracker |
|
|
the description of the bugtracker |
|
|
the authentication Policy of the bugtracker: 'USER' or 'APP_LEVEL' |
|
|
the authentication Protocol of the bugtracker: 'BASIC_AUTH' or 'OAUTH_A1' |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this bug tracker |
Delete bug tracker
A DELETE
to /bug-trackers/{ids}
deletes one or several bug tracker(s) with the given id(s).
HTTP request
DELETE /api/rest/latest/bug-trackers/2,3 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
a list id of the bugtracker |
Get bug tracker credentials
A GET
to /bug-trackers/{id}/credentials
get the credentials of the bug tracker with the given id.
-
In case of basic auth credentials:
HTTP request
GET /api/rest/latest/bug-trackers/1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
the id of the bug-tracker |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 195
{
"_type" : "basic-auth-credentials",
"username" : "user@henix.fr",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/1/credentials"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
type of credentials, it can be basic-auth-credentials, oauth-1a-credentials or token-auth-credentials |
|
|
the username to authenticate to this bug tracker |
|
|
related links |
-
In case of oauth-1a credentials:
HTTP request
GET /api/rest/latest/bug-trackers/1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
the id of the bug-tracker |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 192
{
"_type" : "oauth-1a-credentials",
"token" : "A9b7DD2e4f5g3Hi",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/1/credentials"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
type of credentials, it can be basic-auth-credentials, oauth-1a-credentials or token-auth-credentials |
|
|
the user token to authenticate to this bug tracker |
|
|
related links |
-
In case of token auth credentials:
HTTP request
GET /api/rest/latest/bug-trackers/1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
the id of the bug-tracker |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 163
{
"_type" : "token-auth-credentials",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/1/credentials"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
type of credentials, it can be basic-auth-credentials, oauth-1a-credentials or token-auth-credentials |
|
|
related links |
Set bug tracker credentials
A POST
to /bug-trackers/{id}/credentials
set the credentials of the bug tracker with the given id.
-
Set basic authentication credentials
HTTP request
POST /api/rest/latest/bug-trackers/1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 106
Host: localhost:8080
{
"_type" : "basic-auth-credentials",
"username" : "user@henix.fr",
"password" : "qcrGmkQxI0J789F"
}
Path parameters
Parameter | Description |
---|---|
|
the id of the bug tracker |
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials |
|
|
the username to authenticate to this bug tracker |
|
|
the password to authenticate to this bug tracker |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 195
{
"_type" : "basic-auth-credentials",
"username" : "user@henix.fr",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/1/credentials"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials |
|
|
the username to authenticate to this bug tracker |
|
|
related links |
-
Set oauth-1a authentication credentials
HTTP request
POST /api/rest/latest/bug-trackers/1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 107
Host: localhost:8080
{
"_type" : "oauth-1a-credentials",
"token" : "A9b7DD2e4f5g3Hi",
"token_secret" : "qcrGmkQxI0J789F"
}
Path parameters
Parameter | Description |
---|---|
|
the id of the bug tracker |
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials |
|
|
the user token to authenticate to this bug tracker |
|
|
the user token secret to authenticate to this bug tracker |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 192
{
"_type" : "oauth-1a-credentials",
"token" : "A9b7DD2e4f5g3Hi",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/1/credentials"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials |
|
|
the user token to authenticate to this bug tracker |
|
|
related links |
-
Set token authentication credentials
HTTP request
POST /api/rest/latest/bug-trackers/1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 82
Host: localhost:8080
{
"_type" : "token-auth-credentials",
"token" : "glpat-yCJ8-ixVcExazMi3Ky3Q"
}
Path parameters
Parameter | Description |
---|---|
|
the id of the bug tracker |
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials |
|
|
the token to authenticate to this bug tracker |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 163
{
"_type" : "token-auth-credentials",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/1/credentials"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials |
|
|
related links |
Get bug tracker authentication configuration
A GET
to /bug-trackers/{id}/auth-configuration
get the authentication configuration of the bug tracker with the given id.
Only a bug tracker using OAuth 1a authentication protocol can have an authentication configuration.
HTTP request
GET /api/rest/latest/bug-trackers/1/auth-configuration HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
the id of the bug-tracker |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 556
{
"_type" : "oauth-1a-configuration",
"consumer_key" : "ge4crGFRumkGxLSJDI0J789H",
"client_secret" : "be4crGEVumkGxLSJDI0J789F",
"signature_method" : "HMAC_SHA1",
"request_token_http_method" : "GET",
"request_token_url" : "https://xsquash.atlassian.net/",
"user_authorization_url" : "https://xsquash.atlassian.net/",
"access_token_http_method" : "GET",
"access_token_url" : "https://xsquash.atlassian.net/",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/1/auth-configuration"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of configuration |
|
|
consumer key |
|
|
request token Http method |
|
|
request token Url |
|
|
access token Http method |
|
|
access token Url |
|
|
user authorization Url |
|
|
client secret |
|
|
signature method |
|
|
related links |
Set bug tracker authentication configuration
A POST
to /bug-trackers/{id}/auth-configuration
sets the authentication configuration of the bug tracker with the given id.
Only a bug tracker using OAuth 1a authentication protocol can have an authentication configuration.
HTTP request
POST /api/rest/latest/bug-trackers/1/auth-configuration HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 426
Host: localhost:8080
{
"_type" : "oauth-1a-configuration",
"consumer_key" : "ge4crGFRumkGxLSJDI0J789H",
"request_token_http_method" : "GET",
"request_token_url" : "https://xsquash.atlassian.net/",
"access_token_http_method" : "GET",
"access_token_url" : "https://xsquash.atlassian.net/",
"user_authorization_url" : "https://xsquash.atlassian.net/",
"client_secret" : "be4crGEVumkGxLSJDI0J789F",
"signature_method" : "HMAC_SHA1"
}
Path parameters
Parameter | Description |
---|---|
|
the id of the bug tracker |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 556
{
"_type" : "oauth-1a-configuration",
"consumer_key" : "ge4crGFRumkGxLSJDI0J789H",
"client_secret" : "be4crGEVumkGxLSJDI0J789F",
"signature_method" : "HMAC_SHA1",
"request_token_http_method" : "GET",
"request_token_url" : "https://xsquash.atlassian.net/",
"user_authorization_url" : "https://xsquash.atlassian.net/",
"access_token_http_method" : "GET",
"access_token_url" : "https://xsquash.atlassian.net/",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/bug-trackers/1/auth-configuration"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of configuration |
|
|
consumer key |
|
|
request token Http method |
|
|
request token Url |
|
|
access token Http method |
|
|
access token Url |
|
|
user authorization Url |
|
|
client secret |
|
|
signature method |
|
|
related links |