Give user resource role on asset workflow
Hi. I have userId, roleId, assetId. I would like to give user role of Report Owner on the asset.
Currently, I'm doing the following:
responsibilityApi.addResponsibility(
AddResponsibilityRequest.builder()
.resourceId(assetId)
.roleId(roleId)
.ownerId(userId)
.build()
);
What I'm doing wrong?
I got this error:
Bruno Barić
Posted 2 years ago · Edited 1 year ago·Last reply 2 years ago
4 comments
Bruno Barić
OP2 years ago · EditedI found what was the problem:
It is important also to use resourceType(ResourceType.Asset)
also is important to include:
import com.collibra.dgc.core.api.model.ResourceType;
Interestingly, resourceType is not Required in API documentation
Andrea Nicole Manalo
·2 years agoHello, @bbaric! I tried your given script, and I got an error saying, "Unexpected asset type: Business Term". I am trying to add a responsibility on a business term asset. Can you help me with my given error? Thank you!
def techSME = execution.getVariable("technicalSME")
def techSMEUuid = execution.getVariable("technicalSMEUuid")
def assetUuid = execution.getVariable("businessTerm")
responsibilityApi.addResponsibility(AddResponsibilityRequest.builder()
.resourceId(assetUuid)
.roleId(string2Uuid("e6f3d73e-b57b-427c-862f-8092b240c10b"))
.ownerId(techSMEUuid)
.resourceType(ResourceType.Asset)
.build())
Bruno Barić
OP2 years ago · Edited@grantrollerson1 Do you maybe have solution?
Thanks :)
Grant Rollerson
·2 years ago@bbaric sorry, missed this