Skip to content
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

Fix update ticket status when ticket task is de-scheduled #16895

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

RomainLvr
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets !32381

When a task is de-scheduled, the ticket status remains In progress (Scheduled) instead of being changed back to In progress (Assigned).

@RomainLvr RomainLvr self-assigned this Apr 5, 2024
@trasher
Copy link
Contributor

trasher commented Apr 5, 2024

Please add a test

@RomainLvr RomainLvr requested review from trasher and Rom1-B April 5, 2024 09:42
src/CommonITILTask.php Outdated Show resolved Hide resolved
@RomainLvr RomainLvr requested a review from orthagh April 12, 2024 06:14
Copy link
Contributor

@Rom1-B Rom1-B left a comment

Choose a reason for hiding this comment

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

There is already a function updateParentStatus, which you could use

|| $needupdateparent)
) {
$input['_status'] = CommonITILObject::PLANNED;
} elseif ($parentitem->fields["status"] == CommonITILObject::PLANNED) {
Copy link
Member

Choose a reason for hiding this comment

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

This method may also be executed, for instance, from the ITILFollowup context. In this case, the begin field would not exist and a SQL error will probably be raised.

A test case should probably be added to ensure that adding a followup on a ticket that has the CommonITILObject::PLANNED status will not fail.

Also, should the parent status be updated if the begin filed was not changed ?

Suggested change
} elseif ($parentitem->fields["status"] == CommonITILObject::PLANNED) {
} elseif (
$parentitem->fields["status"] == CommonITILObject::PLANNED
&& in_array('begin', $this->updates)
&& $this->isField('begin')
) {

@cedric-anne cedric-anne changed the base branch from 10.0/bugfixes to main April 22, 2024 08:46
@cedric-anne
Copy link
Member

I change the target to main branch. This can be considered as a new feature and may have unexpected side effects.

@cedric-anne cedric-anne added this to the 11.0.0 milestone Apr 22, 2024
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.

None yet

5 participants