Field Configuration Issues
Troubleshooting problems with JPD custom field mappings and configurations.
Field Not Found
Error: Field customfield_10001 not found in project
Causes:
- Wrong field ID
- Field doesn't exist
- No permission to access field
- Field is project-specific
Solutions:
-
Discover available fields:
pnpm run discover-fields YOUR_PROJECT -
Copy exact field ID from output
-
Update configuration:
fields:
priority:
field_id: "customfield_10001" # Use exact ID from discover-fields
field_type: "select" -
Validate:
pnpm run validate-config
Field Type Mismatch
Error: Field type mismatch: expected select, got text
Causes:
field_typein config doesn't match actual JPD field type- Field type changed in JPD
Solutions:
-
Check actual field type:
pnpm run discover-fields YOUR_PROJECT -
Update field_type in config:
fields:
priority:
field_id: "customfield_10001"
field_type: "select" # Match actual type from JPD
Common type mappings:
- Dropdown →
select - Multi-select →
array - Number →
number - Text →
text - User picker →
user - Date →
date
Field Value Not Rendering
Symptom: Field value shows as empty or null in GitHub
Common Causes & Solutions:
Wrong Field Path
# Wrong - missing .value
- jpd: "fields.customfield_10001"
github: "labels"
# Correct - includes .value for select fields
- jpd: "fields.customfield_10001.value"
github: "labels"
Array Field Access
# Wrong - missing array index
- jpd: "fields.customfield_10002.value"
github: "labels"
# Correct - access first element
- jpd: "fields.customfield_10002[0].value"
github: "labels"
Optional Field Empty
# Field marked as required but is empty
fields:
impact:
field_id: "customfield_10003"
required: true # Remove if field can be empty
Template Syntax Errors
Invalid Variable Reference
Error: Template syntax error at line 5
# Wrong - typo in field name
template: "{{fields.custmfield_10001.value}}"
# ^ typo
# Correct
template: "{{fields.customfield_10001.value}}"
Missing Filter
# Wrong - filter doesn't exist
template: "{{fields.priority.value | lower}}"
# ^ should be lowercase
# Correct
template: "{{fields.priority.value | lowercase}}"
Unclosed Braces
# Wrong - missing closing brace
template: "priority:{{fields.priority.value | lowercase"
# Correct
template: "priority:{{fields.priority.value | lowercase}}"
Transform Function Issues
Function Not Found
Error: Transform function not found: ./transforms/my-function.ts
Solutions:
-
Check file exists:
ls -la transforms/my-function.ts -
Verify path in config:
mappings:
- jpd: "fields"
github: "labels"
transform_function: "./transforms/my-function.ts" # Must start with ./ -
Check export format:
// Correct - default export
export default function(data: Record<string, any>): string {
return "result";
}
// Wrong - named export
export function myFunction(data: Record<string, any>): string {
return "result";
}
Function Runtime Error
Error: Transform function error: Cannot read property 'value' of undefined
Solutions:
-
Add null checks:
export default function(data: Record<string, any>): string {
// Wrong - no null check
const priority = data.fields.customfield_10001.value;
// Correct - with null checks
const priority = data.fields?.customfield_10001?.value || 'none';
return `priority:${priority}`;
} -
Debug with logging:
export default function(data: Record<string, any>): string {
console.log('Transform data:', JSON.stringify(data, null, 2));
// Your logic here
}
Field Validation Errors
Required Field Empty
Error: Required field 'priority' is empty for issue MTT-5
Solutions:
Option 1: Make field optional
fields:
priority:
field_id: "customfield_10001"
field_type: "select"
required: false # Change to false
Option 2: Provide default value
mappings:
- jpd: "fields.customfield_10001.value"
github: "labels"
template: "priority:{{fields.customfield_10001.value | default: 'none'}}"
Option 3: Filter out issues without required fields
jpd:
jql_filter: "project = MTT AND customfield_10001 IS NOT EMPTY"
Debugging Field Issues
Enable Debug Logging
DEBUG=1 pnpm run dev -- --dry-run
Look for:
- Field values being extracted
- Template rendering
- Transform function calls
Test Field Mapping
-
Discover field:
pnpm run discover-fields YOUR_PROJECT -
Check sample value matches expectations
-
Test in dry-run:
pnpm run dev -- --dry-run -
Look for field in output: Search for field ID in dry-run output
Validate One Field at a Time
Comment out other mappings temporarily:
mappings:
# Test this mapping
- jpd: "fields.customfield_10001.value"
github: "labels"
template: "priority:{{fields.customfield_10001.value | lowercase}}"
# Comment out others temporarily
# - jpd: "fields.customfield_10002"
# github: "labels"
Next Steps
- Sync Problems - Issues not syncing correctly
- Debugging Guide - Advanced debugging techniques
- Field Mappings - Configuration reference
Always run discover-fields before configuring field mappings to ensure you have correct field IDs and types.