formcreator icon indicating copy to clipboard operation
formcreator copied to clipboard

Ticket Assistance question in form does not include the ID in the generated ticket

Open brunomartinstorres opened this issue 1 year ago • 1 comments

Describe the bug When creating a question in the form with the type "GLPI object" and selecting "Assistance - Tickets" as the subitem, the form is published, and a user fills it out. The form is set up with a target that generates a ticket.

For example, a ticket in the dropdown of the question might be displayed as:

"53 - Computer problem"

However, when the target is triggered and the ticket is generated, the line where the Assistance - Tickets question should be printed only shows the title of the ticket without the ID. This can cause confusion since there may be more than one ticket with the same title, but the ID is unique.

The expected behavior would be for the generated ticket to display the same value that appears in the question dropdown, which is "ID - Ticket Title" (e.g., "53 - Computer problem").

To Reproduce Steps to reproduce the behavior:

  1. Create a form with a question of type "GLPI object" and subitem "Assistance - Tickets".
  2. Configure a target to generate a ticket.
  3. Publish the form and have a user fill it out.
  4. Observe the generated ticket: the question shows only the ticket title without the ID.

Expected behavior The generated ticket should display both the ticket ID and title (e.g., "53 - Computer problem"), as it appears in the dropdown.

GLPI / Plugins (please complete the following information):

  • GLPI version: 10.0.16
  • Plugin: Formcreator
  • Plugin version: 2.13.9

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome
  • Version: 129.0.6668.90

Smartphone (please complete the following information):

  • N/A

Additional context This issue can cause confusion when multiple tickets share the same title. Including the ticket ID would help avoid this.

brunomartinstorres avatar Oct 16 '24 14:10 brunomartinstorres

HI

Could you consider instead to use links between tickets ? I think you could generate a target ticket with a link to the other ticket picked from your question.

image

btry avatar Oct 16 '24 14:10 btry

@btry Isso não é uma solução pois não é possível linkar tickets à Mudanças, por exemplo. Portanto entendo que o ideal seja imprimir o ID no target. Tentei buscar dentro do plugin onde ele executa esta ação com o glpiselect, porém não localizei facilmente.

brunomartinstorres avatar Oct 21 '24 12:10 brunomartinstorres

Hi

The try to use a tag like ##answer_42.ID## or ##answer_42.id##

This uses a (undocumented :( ) feature which allows you to write in the target a property of the object. It works with Dropdown questions ans GLPI object questions. The name following the dot (.) is the name of the property as visible in the search criterias available for the item in english. Then if you don't use english, switch ti that language before checking the name of the criteria. If the name contains spaces, replace them with underscore (_).

EDIT: also, be careful, it is case sensitive.

btry avatar Oct 21 '24 12:10 btry

Oh, thank you! This will work for me. It's sad that it's an undocumented feature and the information doesn't end up reaching all users. I still think it's a problem that needs to be resolved, but your suggestion solved my problem. Thanks @btry !

brunomartinstorres avatar Oct 21 '24 15:10 brunomartinstorres

HI

The plugin reached its end of life, then I don't fix anymore the plugin, except if there is a security issue. GLPI 11 will implemente its native forms system to replace Formcreator. Work is in progress, and result is nice. Watch for GLPI 11 beta and giver it a try. I believe this will happen next year.

btry avatar Oct 22 '24 06:10 btry