You are not logged in.
Hi everyone,
I'm working with the latest version of GLPI and trying to use Twig tags to automatically include content from linked knowledge base items within task/followup templates. Here's my current code:
{% for user in ticket.requesters.users %} {{ user.fullname }}
This doc will help you: {% for knowbaseitem in ticket.knowbaseitems %} {{ knowbaseitem.link | raw }}
{{ knowbaseitem.answer | raw }}
{% endfor %}
{% endfor %}
Unfortunately, when I use this template, the knowledge base content doesn't appear. Does anyone have a working example of how to successfully pull knowledge base item content into templates using Twig tags?
Thanks in advance for any help!
Offline
Hello, what you may have been seeing is GLPI issue 17549 on github entitled "ticket.knowbaseitems gets knowbaseitems by id not knowbaseitems_id from knowbaseitem_item" . I would link, but the forum doesn't allow it.
If the values of the id field in glpi_knowbaseitem_item didn't happen to match any of your KB articles' ids, you'd have seen nothing as you describe.
Offline
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline