Product/components used and version/fix level:
10.18
Detailed explanation of the problem:
Hi Guys!
I want to create a sub group to a group using the Java SDK. I tried the following
subscriptionsService.runForTenant(subscriptionsService.getTenant(), () -> {
ManagedObjectRepresentation response = inventoryApi.create(asset);
LOG.info("Group created with id:" + response.getId().getValue());
// make this group as child of unsorted
GId gid = GId.asGId(unsortedGroupMoId.get(subscriptionsService.getTenant()));
ManagedObject managedObjectApi = inventoryApi.getManagedObjectApi(gid);
managedObjectApi.addChildAsset(ManagedObjects.asManagedObject(response.getId()));
});
I get the error that the id is not updatable. Does anyone know how can I assign the newly created group as the child of the group whose Gid i extract in the code above.
Error messages / full error message screenshot / log file:
execution of task failed within tenant : XXXXX - Http status code: 422
{error=“undefined/validationError”,message=“Following fields are not updateable: id”,info=“https://www.cumulocity.com/guides/reference/rest-implementation//#a-name-error-reporting-a-error-reporting",details="null”}
tenant: XXXXX user: service_c2c-integration