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 |
---|---|
|
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-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 |
---|---|---|
|
|
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/{id}/field-mappings/{filedId}
returns the field mappings 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-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 |
---|---|---|
|
|
the id of field mapping |
|
|
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 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
Links
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
Parameter | Description |
---|---|
|
the id of the project |
|
the id of the field mapping |
|
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 of field mapping |
|
|
squash Field |
|
|
jira Field |
|
|
locked |
Links
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
Parameter | Description |
---|---|
|
the id of the project |
|
the id of the field mapping |
|
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 of field mapping |
|
|
squash Field |
|
|
jira Field |
|
|
locked |
Links
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
Parameter | Description |
---|---|
|
the id of the project |
|
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