Validation Rule for Responsibilities
Anyone knows how i can validate at least one user is defined for responsibility when validating an item?
Should be something like below but i don’t know what I should put on the questionmarks.
Thanks a lot in advance!
rule{
when {
isEqual(type.id, ‘859285df-7851-4b89-a376-26b4bf1ad45e’)
}
then{
condition{isNotEmpty(<?????>.‘Owner’, message: “The asset must have an Owner”)}
}
}
jurgentock
Posted 5 years ago · Edited 1 year ago·Last reply 2 years ago
3 comments
noor
·5 years ago · EditedThis link is not working. I realized that the validation functions described in the documentation may not meet all requirements, hence customisation will be necessary. For example, I need to validate if an asset like table has atleast 3 tags defined against it. I think then the tag values become a collection, and I really couldn’t find a way to get the number of items in the collection aka the number of tags.
So probably I will end up writing logic in java APIs.
thomaswood
·2 years ago · EditedIs it possible to write a custom script to test for the presence of a responsibility? A workflow to do this is not always the best answer for those creating a new asset.
arthurburkhardt
·5 years ago · EditedI don’t think there is, but possible to extend the validation rules with custom .groovy: https://productresources.collibra.com/docs/cloud-admin/latest/#DGCSettings/OperatingModel/ValidationRules/ValidationLogic/ValidationFunctions/ta_add-groovy-class-custom-validation-functions.htm
I haven’t tried it, but I guess you can use the ResponsibilityApi to find roles…