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

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: 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

_embedded.bug-trackers

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 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

Table 1. /api/rest/latest/bug-trackers/{id}
Parameter Description

id

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

id

Number

the id of the entity

_type

String

the type of the entity

name

String

name of the bug-tracker

url

String

url of the bugtracker

kind

String

kind of the bugtracker : mantis or jira

iframe_friendly

Boolean

the bugtracker displays in iframe

authentication_policy

String

authentication Policy : USER or APP

authentication_protocol

String

Protocol of authentification: Basic Auth or Oauth 1

_links

Object

related links

Relation Description

self

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

_type

String

the type of the entity

name

String

the name of bug tracker

url

String

the url of the bug tracker

kind

String

the kind of the bug tracker

iframe_friendly

Boolean

the description of the bug tracker

authentication_policy

String

the authentication Policy of the bug tracker : 'USER' or 'APP_LEVEL'

authentication_protocol

String

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

_type

String

the type of the entity

id

Number

the id of the bug tracker

name

String

the name of the bug tracker

url

String

the url of the bug tracker

kind

String

the kind of the bug tracker

iframe_friendly

Boolean

the description of the bug tracker

authentication_policy

String

the authentication Policy of the bug tracker: 'USER' or 'APP_LEVEL'

authentication_protocol

String

the authentication Protocol of the bug tracker: 'BASIC_AUTH' or 'OAUTH_A1'

_links

Object

related links

Relation Description

self

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

Table 1. /api/rest/latest/bug-trackers/{id}
Parameter Description

id

the id of the bugtracker you want to update

Request fields

Path Type Description

_type

String

the type of the entity

name

String

the name of bug tracker

url

String

the url of the bug tracker

kind

String

the kind of the bug tracker

iframe_friendly

Boolean

the description of the bug tracker

authentication_policy

String

the authentication Policy of the bug tracker: 'USER' or 'APP_LEVEL'

authentication_protocol

String

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

_type

String

the type of the entity

id

Number

the id of the bugtracker

name

String

the name of the bugtracker

url

String

the url of the bugtracker

kind

String

the kind of the bugtracker

iframe_friendly

Boolean

the description of the bugtracker

authentication_policy

String

the authentication Policy of the bugtracker: 'USER' or 'APP_LEVEL'

authentication_protocol

String

the authentication Protocol of the bugtracker: 'BASIC_AUTH' or 'OAUTH_A1'

_links

Object

related links

Relation Description

self

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

Table 1. /api/rest/latest/bug-trackers/{ids}
Parameter Description

ids

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

Table 1. /api/rest/latest/bug-trackers/{id}/credentials
Parameter Description

id

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

String

type of credentials, it can be basic-auth-credentials, oauth-1a-credentials or token-auth-credentials

username

String

the username to authenticate this bug tracker

_links

Object

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

Table 1. /api/rest/latest/bug-trackers/{id}/credentials
Parameter Description

id

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

String

type of credentials, it can be basic-auth-credentials, oauth-1a-credentials or token-auth-credentials

token

String

the user token to authenticate this bug tracker

_links

Object

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

Table 1. /api/rest/latest/bug-trackers/{id}/credentials
Parameter Description

id

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

String

type of credentials, it can be basic-auth-credentials, oauth-1a-credentials or token-auth-credentials

_links

Object

related links

Set bug tracker credentials

A POST to /bug-trackers/{id}/credentials set the credentials of the bug tracker with the given id.

  • In case of basic auth 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

Table 1. /api/rest/latest/bug-trackers/{id}/credentials
Parameter Description

id

the id of the bug tracker

Request fields

Path Type Description

_type

String

the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials

username

String

the username to authenticate this bug tracker

password

String

the password to authenticate 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

_type

String

the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials

username

String

the username to authenticate this bug tracker

_links

Object

related links

  • In case of oauth-1a 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

Table 1. /api/rest/latest/bug-trackers/{id}/credentials
Parameter Description

id

the id of the bug tracker

Request fields

Path Type Description

_type

String

the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials

token

String

the user token to authenticate this bug tracker

token_secret

String

the user token secret to authenticate 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

_type

String

the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials

token

String

the user token to authenticate this bug tracker

_links

Object

related links

  • In case of token auth credentials:

HTTP request

POST /api/rest/latest/bug-trackers/1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 70
Host: localhost:8080

{
  "_type" : "token-auth-credentials",
  "token" : "A7B2G9F1H1R6E4"
}

Path parameters

Table 1. /api/rest/latest/bug-trackers/{id}/credentials
Parameter Description

id

the id of the bug tracker

Request fields

Path Type Description

_type

String

the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials

token

String

the token to authenticate 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

_type

String

the type of the credentials: basic-auth-credentials, oauth-1a-credentials or token-auth-credentials

_links

Object

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

Table 1. /api/rest/latest/bug-trackers/{id}/auth-configuration
Parameter Description

id

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

_type

String

the type of configuration

consumer_key

String

consumer key

request_token_http_method

String

request token Http method

request_token_url

String

request token Url

access_token_http_method

String

access token Http method

access_token_url

String

access token Url

user_authorization_url

String

user authorization Url

client_secret

String

client secret

signature_method

String

signature method

_links

Object

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

Table 1. /api/rest/latest/bug-trackers/{id}/auth-configuration
Parameter Description

id

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

_type

String

the type of configuration

consumer_key

String

consumer key

request_token_http_method

String

request token Http method

request_token_url

String

request token Url

access_token_http_method

String

access token Http method

access_token_url

String

access token Url

user_authorization_url

String

user authorization Url

client_secret

String

client secret

signature_method

String

signature method

_links

Object

related links