Field mappings

This chapter focuses on field mappings.

Get all field mappings

A GET to /projects/{id}/field-mappings returns all the field mappings of a project.

HTTP request

GET /api/rest/latest/projects/14/field-mappings 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: 852

{
  "_embedded" : {
    "field-mappings" : [ {
      "_type" : "field-mapping",
      "locked" : false,
      "squash_field" : "CREATED_BY",
      "jira_field" : "createdBy",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/projects/14/field-mappings/CREATED_BY"
        }
      }
    }, {
      "_type" : "field-mapping",
      "locked" : false,
      "squash_field" : "CREATED_ON",
      "jira_field" : "createdOn",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/projects/14/field-mappings/CREATED_ON"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/field-mappings"
    }
  },
  "page" : {
    "size" : 2,
    "totalElements" : 2,
    "totalPages" : 1,
    "number" : 0
  }
}

Response fields

Path Type Description

_embedded.field-mappings

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

A GET to /projects/{projectId}/field-mappings/{id} returns the field mapping with the given id.

Path parameters

Table 1. /api/rest/latest/projects/{id}/field-mappings/{fieldId}
Parameter Description

id

the id of the project

fieldId

the id of the field mapping

HTTP request

GET /api/rest/latest/projects/14/field-mappings/CREATED_BY HTTP/1.1
Accept: application/json
Host: localhost:8080

HTTP response

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

{
  "_type" : "field-mapping",
  "locked" : false,
  "squash_field" : "CREATED_BY",
  "jira_field" : "create",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/field-mappings/CREATED_BY"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

squash_field

String

squash Field

jira_field

String

jira Field

locked

Boolean

locked

_links

Object

related links

Relation Description

self

link to this field-mapping

Create field mappings

A POST to /projects/{id}/field-mappings creates a new field mapping.

HTTP request

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

{
  "_type" : "field-mapping",
  "squash_field" : "CREATED_BY",
  "jira_field" : "create"
}

Path parameters

Table 1. /api/rest/latest/projects/{id}/field-mappings
Parameter Description

id

the id of the project

HTTP response

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

{
  "_type" : "field-mapping",
  "locked" : false,
  "squash_field" : "CREATED_BY",
  "jira_field" : "create",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/field-mappings/CREATED_BY"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

squash_field

String

field of the mapping on squash side

jira_field

String

field of the mapping on jira side

locked

Boolean

whether the field is locked

_links

Object

related links

Relation Description

self

link to this entity

Modify field mapping

A PATCH to /projects/{projectId}/field-mappings/{id} modifies the field mapping with the given id.

HTTP request

PATCH /api/rest/latest/projects/14/field-mappings/CREATED_BY HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 95
Host: localhost:8080

{
  "_type" : "field-mapping",
  "squash_field" : "Created by",
  "jira_field" : "created by"
}

Path parameters

Table 1. /api/rest/latest/projects/{projectId}/field-mappings/{id}
Parameter Description

projectId

the id of the project

id

the id of the field mapping, the id of a field mapping is its squash field name

HTTP response

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

{
  "_type" : "field-mapping",
  "locked" : false,
  "squash_field" : "Created by",
  "jira_field" : "created by",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/field-mappings/Created%2520by"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

squash_field

String

field of the mapping on squash side

jira_field

String

field of the mapping on jira side

locked

Boolean

whether the field is locked

_links

Object

related links

Relation Description

self

link to this field-mapping

Delete field mappings

A DELETE to /info-lists/{id} deletes the field mapping with the given id.

HTTP request

DELETE /api/rest/latest/projects/14/field-mappings/CREATED_BY,CREATED_ON HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080

Path parameters

Table 1. /api/rest/latest/projects/{id}/field-mappings/{ids}
Parameter Description

id

the id of the project

ids

a list of ids of the field mappings

HTTP response

HTTP/1.1 204 No Content