Hello everyone,
I would like to ask if there is a supported or recommended way to access custom fields created with the Fields plugin and attached to Users, directly inside notification templates.
Context
In notification templates, we can already access standard user attributes without problems.
For example, iterating ticket observers works as expected:
{% for user in ticket.observers.users %}
{{ user.fullname }}
{% endfor %}
However, in my environment we rely heavily on custom fields associated with users (created via the Fields plugin), such as:
- internal identifiers
- integration / directory-related attributes
- role-specific metadata
- environment-specific references
These fields are already stored correctly and exposed in the GLPI UI, but I haven’t found a way to retrieve them from notification templates.
What I am trying to achieve
Conceptually, something like:
{{ user.my_custom_field }}
or a structured access such as:
{{ user.additional_fields.block.field }}
where the custom fields are those defined via the Fields plugin and linked to the User object.
Questions
-
Is access to Fields plugin custom fields from notification templates:
- intentionally not supported?
- or simply not implemented yet?
-
Is there any existing workaround, hook, or internal API that could be used to fetch user custom fields in notifications?
-
Would it be considered acceptable (from a design and security standpoint) to expose custom fields in the context, similarly to other user attributes, in a read-only way?
Why this would be useful
In real-world deployments, notifications often need to include:
- custom identity data
- business-specific user attributes
- data required by external systems or workflows
Being able to reuse Fields plugin data would avoid duplication, hardcoding, or external scripts, and would greatly improve notification flexibility.
If this topic has already been discussed elsewhere or if there are technical constraints I’m not aware of, I’d really appreciate any pointers or guidance.
Thank you in advance to the community and the GLPI maintainers.
Hello everyone,
I would like to ask if there is a supported or recommended way to access custom fields created with the Fields plugin and attached to Users, directly inside notification templates.
Context
In notification templates, we can already access standard user attributes without problems.
For example, iterating ticket observers works as expected:
However, in my environment we rely heavily on custom fields associated with users (created via the Fields plugin), such as:
These fields are already stored correctly and exposed in the GLPI UI, but I haven’t found a way to retrieve them from notification templates.
What I am trying to achieve
Conceptually, something like:
or a structured access such as:
where the custom fields are those defined via the Fields plugin and linked to the User object.
Questions
Is access to Fields plugin custom fields from notification templates:
Is there any existing workaround, hook, or internal API that could be used to fetch user custom fields in notifications?
Would it be considered acceptable (from a design and security standpoint) to expose custom fields in the context, similarly to other user attributes, in a read-only way?
Why this would be useful
In real-world deployments, notifications often need to include:
Being able to reuse Fields plugin data would avoid duplication, hardcoding, or external scripts, and would greatly improve notification flexibility.
If this topic has already been discussed elsewhere or if there are technical constraints I’m not aware of, I’d really appreciate any pointers or guidance.
Thank you in advance to the community and the GLPI maintainers.