Field mappings

This chapter focuses on field mappings.

Get all field mappings

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

HTTP request

GET /api/rest/latest/projects/14/field-mappings?page=1&size=20 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-Length: 645
Content-Type: application/json;charset=UTF-8

{
  "_embedded" : {
    "field-mappings" : [ {
      "squashField" : "CREATED_BY",
      "jiraField" : "create",
      "locked" : false,
      "id" : "CREATED_BY"
    }, {
      "squashField" : "CREATED_ON",
      "jiraField" : "create",
      "locked" : false,
      "id" : "CREATED_ON"
    } ]
  },
  "_links" : {
    "self" : [ {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/field-mappings?page=0&size=20"
    }, {
      "href" : "org.springframework.web.servlet.support.ServletUriComponentsBuilder@1001b435"
    } ]
  },
  "page" : {
    "size" : 20,
    "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/{id}/field-mappings/{filedId} returns the field mappings 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-Length: 237
Content-Type: application/json;charset=UTF-8

{
  "squashField" : "CREATED_BY",
  "jiraField" : "create",
  "locked" : false,
  "id" : "CREATED_BY",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/field-mappings/CREATED_BY"
    }
  }
}

Response fields

Path Type Description

id

String

the id of field mapping

squashField

String

squash Field

jiraField

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

HTTP request

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

{
  "_type" : "field-mapping",
  "squashField" : "CREATED_BY",
  "jiraField" : "create",
  "locked" : false,
  "id" : "CREATED_BY"
}

Request fields

Snippet request-fields not found for operation::RestFieldMappingControllerIT/add-new-field-mapping

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
Content-Length: 103

{
  "squashField" : "CREATED_BY",
  "jiraField" : "create",
  "locked" : false,
  "id" : "CREATED_BY"
}

Response fields

Snippet response-fields not found for operation::RestFieldMappingControllerIT/add-new-field-mapping

Snippet links not found for operation::RestFieldMappingControllerIT/add-new-field-mapping

Modify jira field mappings

Warning
This feature may be modified in further versions.

A PATCH to /projects/{id}/field-mappings/{fieldId}/jira/{jiraField} modifies the jira field mappings with the given id.

HTTP request

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

Path parameters

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

id

the id of the project

fieldId

the id of the field mapping

jiraField

the new jira field mapping

Request fields

Snippet request-fields not found for operation::RestFieldMappingControllerIT/update-jira-field-mapping

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 103

{
  "squashField" : "CREATED_BY",
  "jiraField" : "create",
  "locked" : false,
  "id" : "CREATED_BY"
}

Response fields

Path Type Description

id

String

id of field mapping

squashField

String

squash Field

jiraField

String

jira Field

locked

Boolean

locked

Snippet links not found for operation::RestFieldMappingControllerIT/update-jira-field-mapping

Modify squash field mappings

Warning
This feature may be modified in further versions.

A PATCH to /projects/{id}/field-mappings/{fieldId}/squash/{squashField} modifies the squash field mappings with the given id.

HTTP request

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

Path parameters

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

id

the id of the project

fieldId

the id of the field mapping

squashField

the new squash field mapping

Request fields

Snippet request-fields not found for operation::RestFieldMappingControllerIT/update-squash-field-mapping

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 103

{
  "squashField" : "CREATED_BY",
  "jiraField" : "create",
  "locked" : false,
  "id" : "CREATED_BY"
}

Response fields

Path Type Description

id

String

id of field mapping

squashField

String

squash Field

jiraField

String

jira Field

locked

Boolean

locked

Snippet links not found for operation::RestFieldMappingControllerIT/update-squash-field-mapping

Delete field mappings

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

Path parameters

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

id

the id of the project

ids

a list of id of field mapping

HTTP request

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

[[delete_field_mappings http_response]] ==== http response

Snippet http-response not found for operation::RestFieldMappingControllerIT/delete-field-mapping