customFields.add
Add Jira custom fields to a connection’s allowlist while preserving its existing selections.
Facts
| Method | POST https://yourinstance.getdx.net/api/connections/:connection_id/customFields.add |
Arguments
Required arguments
| Name | Type | Description |
|---|---|---|
token |
Token |
Data Cloud API key passed in the Authorization: Bearer HTTP header. See Authentication. |
connection_id |
Integer |
The Jira connection ID. Substitute this value for :connection_id in the URL path. Find it with connections.list. |
field_keys |
Array<String> |
One to 10,000 Jira field keys, such as ["customfield_10001"]. Each value must be a nonblank string. The limit counts duplicate entries. |
Optional arguments
| Name | Type | Description |
|---|---|---|
force |
Boolean |
Defaults to false. Set to true to apply recognized keys and report unmatched keys in the response. A nonempty request with no recognized keys is rejected even when force is true. |
Usage info
This method supports Jira Cloud and Jira Data Center connections. It does not support Jira extractor connections. Find the connection ID with connections.list and field keys with customFields.list.
Use Jira field keys, not field names. A key must be discovered for the connection’s Jira instance or already present in its saved allowlist. Duplicate keys are collapsed and surrounding whitespace is trimmed.
The 10,000-key limit applies per request, not to the total saved allowlist. To allowlist more fields, send multiple customFields.add requests with up to 10,000 keys each. Do not split the list across multiple customFields.set requests: each request replaces the entire allowlist.
Adding fields saves the allowlist during the request, then triggers a connection resync in the background. Re-adding a selected field does not trigger another historical update.
These methods manage the explicit custom field allowlist. Dedicated story point and sprint settings are configured separately. Project selection is managed through importFilters.list and its related methods.
Unmatched keys
By default, any unmatched key rejects the entire request without changing the allowlist. With force: true, recognized keys are applied and the response returns status: "partial_success". The unmatched array contains one object per skipped key, with identifier set to the submitted key and reason: "not_found".
If no supplied key resolves, the request fails with no_fields_resolved even when force is true.
Example request
curl -X POST "https://yourinstance.getdx.net/api/connections/123/customFields.add" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxxx-xxxxxxxxx-xxxx" \
--data '{
"field_keys": [
"customfield_10001",
"customfield_10002"
]
}'
Success response
This example starts with an empty explicit allowlist.
{
"ok": true,
"connection_id": 123,
"status": "success",
"unmatched": [],
"field_keys": ["customfield_10001", "customfield_10002"],
"added": ["customfield_10001", "customfield_10002"],
"removed": []
}
| Field | Type | Description |
|---|---|---|
ok |
Boolean |
true when the request succeeds. |
connection_id |
Integer |
The Jira connection ID. |
status |
String |
success when all keys resolve, or partial_success when force: true skips unmatched keys. |
field_keys |
Array<String> |
The complete resulting allowlist, including selections preserved by this operation. |
added |
Array<String> |
Keys added to the allowlist by this request. |
removed |
Array<String> |
Keys removed from the allowlist by this request. |
unmatched |
Array<Object> |
Skipped keys, each with identifier and reason. Empty when every key resolves. |
Forced partial match example
curl -X POST "https://yourinstance.getdx.net/api/connections/123/customFields.add" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxxx-xxxxxxxxx-xxxx" \
--data '{
"field_keys": ["customfield_10001", "unknown_field"],
"force": true
}'
For an initially empty allowlist, the response is:
{
"ok": true,
"connection_id": 123,
"status": "partial_success",
"unmatched": [
{
"identifier": "unknown_field",
"reason": "not_found"
}
],
"field_keys": ["customfield_10001"],
"added": ["customfield_10001"],
"removed": []
}
Errors
| Error | Description |
|---|---|
not_authed |
The request did not include a valid Data Cloud API key. |
connection_not_found |
No connection exists for the given connection_id. Returns HTTP 404. |
invalid_custom_fields |
The connector is unsupported, or field_keys is missing, malformed, contains blank values, or exceeds 10,000 entries. An empty array is valid only for set. Returns HTTP 422. |
unresolved_fields |
Some keys resolved and others did not, and force was not true. The response includes unmatched; no changes were made. Returns HTTP 422. |
no_fields_resolved |
None of the keys in a nonempty request resolved. The response includes unmatched; no changes were made, even with force: true. Returns HTTP 422. |
invalid_json |
The request body is not valid JSON. Returns HTTP 422. |