Skip to content

Conversation

@Herafia
Copy link
Contributor

@Herafia Herafia commented Oct 16, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • 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

A client reported an issue when exporting and re-importing business rules for tickets in an environment where ITIL categories were translated.
During export, the XML file contained the translated value of the ITIL category (depending on the user interface language), but during import, the rule engine only recognized the original (non-translated) category name.
As a result, importing rules failed when the export and import were performed in different languages.
The export process has been adjusted to always include the category name (fields["name"]), regardless of the interface language used at the time of export.

  • It fixes !39802

Change:
The XML export now returns the label (fields['name']) for dropdown references instead of the ID.
This improves readability and consistency with other export formats.

Modifications:
Updated the expected test in phpunit/functional/RuleRightCollectionTest.php to use fields['name'] when building the expected XML output.

Screenshots (if appropriate):

@Herafia Herafia self-assigned this Oct 16, 2025
$criteria['pattern'],
false,
true,
false,
Copy link
Contributor

Choose a reason for hiding this comment

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

In the case of the customer, isn't this change enough?
The foreach before doesn't seem necessary to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Rom1-B The code was looking for criteria by their ID (mail_server), but they’re indexed by their key (MAIL_SERVER) in the available criteria array. As a result, isCriteriaADropdown() always returned false, and getDropdownName() was never called.

The loop to map IDs to keys, and now it works: the XML correctly contains the names instead of the IDs.

Could you ask for customer validation?

@Rom1-B Rom1-B requested a review from stonebuzz October 23, 2025 14:15
@Herafia
Copy link
Contributor Author

Herafia commented Oct 24, 2025

@Rom1-B The code was looking for criteria by their ID (mail_server), but they’re indexed by their key (MAIL_SERVER) in the available criteria array. As a result, isCriteriaADropdown() always returned false, and getDropdownName() was never called.

The loop to map IDs to keys, and now it works: the XML correctly contains the names instead of the IDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants