Skip to content

Conversation

@AdrienClairembault
Copy link
Contributor

@AdrienClairembault AdrienClairembault commented Dec 5, 2025

Checklist before requesting a review

  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.

Description

Add a new configuration value for forms destinations:

image

This is useful when a technician is filling a form and the ticket requester is selected from the form's question:

image

Here, you want the ticket to be created in the entity of the user from the "Requester" question.

As you know, GLPI lack a "default" entity for a user (the "Default entity" user setting is missnamed and not fit for this purpose as we all know - it is an UX pref setting and do not represent the "main" profile assignment of a user).

So the rules to get the correct entity are:

  • If the user has a single profile, take the entity of this profile
  • If the user has multiple profiles but only one "helpdesk" profile, take the entity of this profile
  • If the user has multiple helpdesk profiles, take the entity of the first one (not ideal but we have no better solutions here. Note that this case is very unlikely to happen as it doesn't make sense to configure your form that way if you have requesters assigned to multiples entities. We can just see this as a safe fallback to avoid unexpected cases).

References

Internal support ticket: !40514

@AdrienClairembault AdrienClairembault marked this pull request as ready for review December 5, 2025 15:29
Comment on lines +100 to +101
// TODO: why does this field seems to support multiple stategies?
// It doesn't make sense IMO, can you take a look @ccailly?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @ccailly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ccailly did not respond to the ping, maybe could you @AdrienClairembault open an issue and assign him?

@AdrienClairembault
Copy link
Contributor Author

Some existing tests need to be updated since I've modified the bootstrap data, hold on I'll do it a bit later today.

Copy link
Contributor

@trasher trasher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@trasher trasher merged commit 99c8625 into glpi-project:11.0/bugfixes Dec 10, 2025
8 checks passed
@AdrienClairembault AdrienClairembault deleted the fix/entity-from-requester branch December 10, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants