You’ve hit a well-documented limitation in the Config Management API’s handling of custom attributes. The solution requires addressing all three focus areas systematically.
1. Custom attribute mapping: The API expects custom attributes to be referenced using their fully qualified internal names. Your current reference is incorrect. Retrieve the proper name:
GET /Windchill/servlet/odata/ProdMgmt/AttributeDefinitions
Filter: displayName eq 'CustomLeadTime'
The response will show the internal name, typically formatted as IBA|customLeadTime or com.yourcompany.CustomLeadTime. Update your payload:
{"includeAttributes": ["Material", "Cost", "IBA|customLeadTime"]}
2. Type system configuration: Custom attributes must be explicitly registered in the Config Management type mapping. Edit site.xconf and add:
<Property name="com.ptc.windchill.config.customAttributes"
value="IBA|customLeadTime:java.lang.Double"/>
This maps your custom attribute to its Java type. Restart the method server after this change.
3. API payload validation: The Config Management API performs schema validation before processing. Your payload must include type hints for custom attributes:
{
"sourceConfig": "OR:789",
"targetConfig": "OR:790",
"includeAttributes": [
{"name": "Material", "type": "string"},
{"name": "Cost", "type": "double"},
{"name": "IBA|customLeadTime", "type": "double", "customType": "IBA"}
],
"validateSchema": true
}
The customType: IBA flag tells the API to use the IBA attribute handler instead of standard attribute serialization.
Complete solution:
- Query attribute definitions to get internal names
- Update site.xconf with custom attribute type mappings
- Restart Windchill method server
- Modify your API payload to include type hints
- Add error handling for partial sync scenarios
Alternative if this fails: Use the lower-level Parts API with explicit attribute updates:
PATCH /Windchill/servlet/odata/ProdMgmt/Parts('OR:component')
{
"IBA|customLeadTime": 14.5,
"_configContext": "OR:790"
}
This approach updates attributes directly on part instances within a configuration context, avoiding the Config Management API’s validation layer. Process each BOM component individually in a batch operation. Less elegant but more reliable for custom attributes.