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 |
---|---|
|
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) |
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 |
---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements the client is allowed to read |
|
|
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 field mapping
A GET
to /projects/{projectId}/field-mappings/{id}
returns the field mapping with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the project |
|
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 |
---|---|---|
|
|
the type of the entity |
|
|
squash Field |
|
|
jira Field |
|
|
locked |
|
|
related links |
Links
Relation | Description |
---|---|
|
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
Parameter | Description |
---|---|
|
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 |
---|---|---|
|
|
the type of the entity |
|
|
field of the mapping on squash side |
|
|
field of the mapping on jira side |
|
|
whether the field is locked |
|
|
related links |
Links
Relation | Description |
---|---|
|
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
Parameter | Description |
---|---|
|
the id of the project |
|
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 |
---|---|---|
|
|
the type of the entity |
|
|
field of the mapping on squash side |
|
|
field of the mapping on jira side |
|
|
whether the field is locked |
|
|
related links |
Links
Relation | Description |
---|---|
|
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
Parameter | Description |
---|---|
|
the id of the project |
|
a list of ids of the field mappings |
HTTP response
HTTP/1.1 204 No Content