Skip to content

[GLPI 11] Custom Fileds in notification templates #1184

@HINE-dev

Description

@HINE-dev

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

  1. Is access to Fields plugin custom fields from notification templates:

    • intentionally not supported?
    • or simply not implemented yet?
  2. Is there any existing workaround, hook, or internal API that could be used to fetch user custom fields in notifications?

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions