Notification Workflow when Asset is Added
Hello,
I would like to send a notification to users when an asset is created and need to find the users assigned to a specific role at the domain/vocabulary level for the asset added.
Wondering if anyone has a sample code that they can share or have suggestions on how to find the members for the responsibilities at the domain level… If i define the resource ID for the domain, can i pass it to the find responsibilities builder method?
This is my approach:
def roleIds = users.getRoleIds(roleNames).collect{it}
loggerApi.info(“Role Ids are: ${roleIds}”)
// Find the responsibilities for the Role passed.
def respMembers = responsibilityApi.findResponsibilities(FindResponsibilitiesRequest.builder()
.resourceIds(string2Uuid(domainID))
.roleIds(roleIds)
.build()).getResults()
// Find user Ids
Thanks,
Aruna