I was working in the approvals arena today and was looking at how the activity calculates the list of attributes that are provided to the end user as part of “[//Target]. It would appear that the system parses out the attributes from the “User” and “Group” objects only for this list.
In my environment I have a custom object with a variety of attributes. If I go to validate the “[//Target/CustomAttribute]” in the out of box approval activity it won’t allow me to use it. This is due to where the activity is looking for the list of reference attributes to use as allowable from the target.
The workaround for this is to add the custom attributes to the “Group” or “User” object. Remember they have to be defined as reference attribute types as the need to be resolved back to a list of objects for the approval. Once added to the Group/User object, the custom attributes will be listed in the allowed attributes for “Target” when you do a lookup or do a validation on a manually typed string of ‘[//Target/CustomAttribute]’. Once configured, the target resource type is not constrained and any custom object (or out of the box one for that matter) can be used.
I did look around to see if I could find a configuration setting for what objects the approval would parse to get its list of attributes but I didn’t find anything. If someone has found a configuration setting for this, please let me know as I would love to have this completed more elegantly.