Skip to content

Change Service Status Announcements PR Review

Ed Mozley edited this page Dec 5, 2026 · 1 revision

Announcing a change's outage on Service Status - PR review (#511)

PR #511 by @Dr4inder Β· Change Management and Service Status Β· merged 5 December 2026, in 6.0.0

Verdict: merge + fix. A sound design built the way FreeITSM already builds this kind of thing, with two small fixes on top.

What it set out to do

A change records its outage window, and Service Status has had planned maintenance since 3.2.0, but the two were not connected. To tell people about a change's outage, somebody typed it again on Service Status, and if the change moved or was cancelled nothing on the change showed that an announcement was out there.

Projects already announce disruption from their Connections tab (ProjectToolsService::announce). This PR gives changes the same thing: a Service Status section on the change, an Announce dialog filled in from the change's title and outage window, Withdraw on an upcoming row, both in the change's history, and a From the change CHG-0183 link back on Service Status.

Before After
The change page before: Linked tickets, then Activity The Service Status section with one upcoming announcement

The Announce dialog, filled in from the change's title and outage window

What was good - copy this

  • It is a twin, not a new invention. ChangesService::announce(), withdrawAnnouncement() and announcements() mirror the Projects methods, and the two dialogs now share one function for their choices (statusPlannedChoices()), so Projects changed by deleting code. When a feature already exists elsewhere, reuse its shape: a reader who knows one knows both.

  • Service layer, thin endpoint. All the rules - write access to Changes, access to Service Status, the change must exist and be in scope, the announcement must belong to the change - are in includes/services/changes.php. api/change-management/announce.php only reads the request and calls the service, and it is POST only (csrfRequireWriteMethod()).

  • It works before Database Verification. An upgraded install runs the new code before anybody runs Verification, so nothing names the new status_planned.change_id column until it exists:

    function statusPlannedChangeReady(PDO $conn): bool
    {
        static $ready = null;
        if ($ready === null) {
            try { $ready = (bool)$conn->query("SHOW COLUMNS FROM status_planned LIKE 'change_id'")->fetch(PDO::FETCH_ASSOC); }
            catch (Throwable) { $ready = false; }
        }
        return $ready;
    }

    Before Verification the Service Status list still loads, the change page shows no section, and announcing says to run Verification. Even the insert writes the column in its own statement, so a save without a change never names it.

  • Schema in all three places - database/freeitsm.sql, includes/db_verify_schema.php and the foreign key list in api/system/db_verify.php - with the index file regenerated rather than hand-edited.

  • Nothing can be forged from the other side. Service Status's own endpoint drops change_id from the request, as it already dropped project_id, so only Changes - which checks the change - can attach one. An edit on Service Status keeps the change, because statusPlannedSave() sets it only on a new row.

  • Who sees what was thought through: no section without Service Status, no buttons with read-only Changes.

  • A test that proves the rules, including the refusals and a control: tests/change-announce-maintenance.php (20 checks).

What had to be fixed

1. A help sentence had been pasted into itself. The new help note read:

...puts it on Service Status (and the portal, if incidents are shown there), with the changeputs it on Service Status and the portal, with the change’s titlersquo;s title and outage window filled in.

Easy to miss in a diff of a long string; obvious on the help page. It now reads "...with the change's title and outage window filled in." Lesson: read new help text where a user will read it, not only in the diff.

2. Two-word buttons. FreeITSM's buttons are one word unless clarity needs more, and the Projects twin already says Announce and + Add service. The change page's Announce maintenance became Announce and Add a service became Add, so the two twins read the same.

3. Translations. The 31 new strings came in English, as the PR said. They are translated with the release's other new strings.

How it was tested

On a test install: the PR's own test passes (20 of 20). In a browser, a change with an outage window opened the dialog filled in from it (12 Dec 22:00 to 13 Dec 02:00), Announce added an Upcoming row and an announced on Service Status line to the history, and Service Status showed From the change CHG-0183 linking to ../change-management/?change_id=183.

Files

File Change
πŸ”΄ includes/services/changes.php announce(), withdrawAnnouncement(), announcements()
πŸ”΄ includes/service_status_planned.php change_id, statusPlannedChangeReady(), statusPlannedChoices()
🟑 api/change-management/announce.php New thin endpoint
🟑 assets/js/change-management.js, change-management/index.php The section and the dialog
🟑 service-status/index.php The From the change link
🟒 database/freeitsm.sql, includes/db_verify_schema.php, includes/db_verify_indexes.php, api/system/db_verify.php status_planned.change_id, its index and foreign key
🟒 tests/change-announce-maintenance.php New

What this means for you

After upgrading, run System β†’ Database Verification (it adds one column). A change's page then has a Service Status section for anyone who can open Service Status. See Change Management and the developer guide.

Related

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally