-
-
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
feat(RuleTicket): add new action 'replace' for actors #15718
base: main
Are you sure you want to change the base?
Conversation
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 am not against this change, but last time we discussed about it, we said that we should not do it in a bugfixes version.
see #11957 (comment)
as you like (I can rebase on main) but it's a bug that's been hanging around until now the rule engine offers 'assign' and 'append' action, the two should have a different behaviour @orthagh what do you think? |
In fact, they act differently, but maybe not as people can expect it.
We talk about it just now. He said it is preferable to fix it in main branch. |
No, for me : A |
I was explaining the current result. What you describe is the result of your proposal. |
bb8ef70
to
2c698b0
Compare
@@ -1167,4 +1167,118 @@ public function testAssignLocationFromUser( | |||
$ticket->getFromDB($ticket->getID()); | |||
$this->integer($ticket->fields['locations_id'])->isEqualTo($expected_location_after_creation); | |||
} | |||
|
|||
public function testAssignGroupOnUpdate() |
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.
Test is not enough complete.
- It should ensure that action like
replace users assigned
will have no impact on requesters and observers, nor on groups or suppliers. - It should verify that replacement also removes actors in existing input (not only existing actors).
- It should verify that, when there is no existing actors, it does not fail.
- It should verify the
ONADD
case too.
You should probably have a data provider that is used to test multiple combinations.
236c2b4
to
bda3ab8
Compare
add new action 'replace' for actors
🤖 Generated by Copilot at 236c2b4
This pull request adds a feature to replace actors of ITIL objects based on rules, instead of appending them. It modifies the
CommonITILObject
,RuleCommonITILObject
, andRuleAction
classes to handle the new action type and input keys for replacing actors. It also adds a test function to verify the feature intests/functional/RuleTicket.php
.🤖 Generated by Copilot at 236c2b4
CommonITILObject
class (link)replace
to thegetActions
function in theRuleAction
class. The optionreplace
is used to indicate that the action type is to replace the value of a field by another value, instead of assigning or appending it (link)_users_id_requester
: replace users as requesters, with the input key_replace_users_requesters
(link)_groups_id_requester
: replace groups as requesters, with the input key_replace_groups_requesters
(link)_users_id_assign
: replace users as assigns, with the input key_replace_users_assigns
(link)_groups_id_assign
: replace groups as assigns, with the input key_replace_groups_assigns
(link)_suppliers_id_assign
: replace suppliers as assigns, with the input key_replace_suppliers_assigns
(link)_users_id_observer
: replace users as observers, with the input key_replace_users_observers
(link)_groups_id_observer
: replace groups as observers, with the input key_replace_groups_observers
(link)