When trying to copy certain blueprints, we get the following error:
CMN-0007: 'ODF_BLUEPRINT' attribute 'context' is required.
The app-ca.log file shows the following error:
ERROR 2025-03-27 00:28:32,191 [http-nio-1630-exec-629] rest.validation (clarity:myuser:mysession:PPM_REST_API) (mytoken) ODFResourceProvider :: Could not copy resource. Object code alias: [ requestUrl: http://example.com/ppm/rest/v1/private/copy/blueprints/5017005 , _restResourceName : blueprints , _id : 5017005 , _parentInfo : null , _apiVersion : v1 , _includeLinksArray : true , _contextId : -1 , _hierarchyId : -1 , _isGroupBy : false , _isPartition : false]
ERROR 2025-03-27 00:28:32,191 [http-nio-1630-exec-629] rest.validation (clarity:myuser:mysession:PPM_REST_API) (mytoken) ExceptionInfo :: Could not copy resource. Resource name: blueprints. Error code: validation.requiredFieldMissingWithCode Error message: CMN-0007: 'ODF_BLUEPRINT' attribute 'context' is required.
ERROR 2025-03-27 00:28:32,192 [http-nio-1630-exec-629] ppm.rest (clarity:myuser:mysession:PPM_REST_API) (mytoken)
com.ca.ppm.rest.exception.BadRequestException: CMN-0007: 'ODF_BLUEPRINT' attribute 'context' is required.
at com.ca.platform.osf.object.rest.provider.ODFResourceProvider.handleODFException(ODFResourceProvider.java:4021)
at com.ca.platform.osf.object.rest.provider.ODFResourceProvider.doCopyEntity(ODFResourceProvider.java:551)
at com.ca.platform.osf.object.rest.provider.ODFResourceProvider.copyEntity(ODFResourceProvider.java:375)
at com.ca.ppm.rest.resource.BaseResourceHandler.copyResource(BaseResourceHandler.java:337)
at com.ca.ppm.rest.resource.ResourceHandler.copyResourceHierarchy(ResourceHandler.java:171)
Clarity 16.3.1
The context value of the blueprint at the DB side is null
At the error message you will find the ID of the blueprint you are trying to copy.
requestUrl: http://example.com/ppm/rest/v1/private/copy/blueprints/5017005
Run the following select query
SELECT context from odf_blueprints WHERE id = 5017005
The context value is null. This needs to be updated:
UPDATE odf_blueprints SET context = 'object' WHERE id = 5017005