-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing inputs for rules using ticket validation criteria #18578
base: 10.0/bugfixes
Are you sure you want to change the base?
Add missing inputs for rules using ticket validation criteria #18578
Conversation
src/CommonITILValidation.php
Outdated
'id' => $this->fields[static::$items_id], | ||
'global_validation' => self::computeValidationStatus($item), | ||
'_from_itilvalidation' => true, | ||
'itemtype' => static::$itemtype | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'id' => $this->fields[static::$items_id], | |
'global_validation' => self::computeValidationStatus($item), | |
'_from_itilvalidation' => true, | |
'itemtype' => static::$itemtype | |
]; | |
'id' => $this->fields[static::$items_id], | |
'global_validation' => self::computeValidationStatus($item), | |
'_from_itilvalidation' => true, | |
] + $item->fields; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we shouldn't simply pass the fields
(from related item) in $input
@cedric-anne what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$item
is a Ticket or a Change. If we update it with all its fields, isn't there a risk of triggering other rules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's why I want cedric's opinion, because it may give rise to a PR on main
(and therefore feature request
).
Checklist before requesting a review
Please delete options that are not relevant.
Description
We create business rules for tickets, if we create a rule using only one criterion which is 'validation' it works, otherwise if we add another criterion in addition to 'validation' the rule never passes.
The problem comes from the fact that when the rule engine is run, the main item is CommonITILValidation, so the inputs to be processed come from this object, which does not contain the ticket fields. So you have to go and find the missing fields you need
Screenshots (if appropriate):
Work :
Dont work :