diff --git a/mod/forum/classes/event/discussion_lock_updated.php b/mod/forum/classes/event/discussion_lock_updated.php
index 66e7eb69bc6..ed426fb5e5a 100644
--- a/mod/forum/classes/event/discussion_lock_updated.php
+++ b/mod/forum/classes/event/discussion_lock_updated.php
@@ -44,11 +44,8 @@ class discussion_lock_updated extends \core\event\base {
      * @return string
      */
     public function get_description(): string {
-        if ($this->other['locked']) {
-            return "The user $this->userid has locked the discussion $this->objectid in the forum {$this->other['forumid']}";
-        }
-
-        return "The user $this->userid has unlocked the discussion $this->objectid in the forum {$this->other['forumid']}";
+        return "The user with id '$this->userid' {$this->other['status']} the discussion: $this->objectid".
+            " in the forum: {$this->other['forumid']}";
     }
 
     /**
@@ -80,8 +76,11 @@ class discussion_lock_updated extends \core\event\base {
         if (!isset($this->other['forumid'])) {
             throw new coding_exception('forumid must be set in $other.');
         }
-        if (!isset($this->other['locked'])) {
-            throw new coding_exception('locked must be set in $other.');
+        if (!isset($this->other['status'])) {
+            throw new \coding_exception('The \'status\' value must be set in other.');
+        }
+        if (!in_array($this->other['status'], ['locked', 'unlocked'], true)) {
+            throw new \coding_exception('The \'status\' value must be \'locked\' or \'unlocked\'.');
         }
         if ($this->contextlevel != CONTEXT_MODULE) {
             throw new coding_exception('Context passed must be module context.');
diff --git a/mod/forum/externallib.php b/mod/forum/externallib.php
index 0be071c9f87..3494737d142 100644
--- a/mod/forum/externallib.php
+++ b/mod/forum/externallib.php
@@ -1752,7 +1752,7 @@ class mod_forum_external extends external_api {
         $params = [
             'context' => $forum->get_context(),
             'objectid' => $discussion->get_id(),
-            'other' => ['forumid' => $forum->get_id(), 'locked' => !empty($lockedvalue)],
+            'other' => ['forumid' => $forum->get_id(), 'status' => empty($lockedvalue) ? 'unlocked' : 'locked'],
         ];
         $event = \mod_forum\event\discussion_lock_updated::create($params);
         $discussionrecord = $DB->get_record('forum_discussions', ['id' => $discussion->get_id()]);
diff --git a/mod/forum/tests/externallib_test.php b/mod/forum/tests/externallib_test.php
index 3e16c9d417c..b7de590b95e 100644
--- a/mod/forum/tests/externallib_test.php
+++ b/mod/forum/tests/externallib_test.php
@@ -1954,7 +1954,7 @@ class externallib_test extends externallib_advanced_testcase {
         $this->assertEquals($context, $event->get_context());
         $this->assertEventContextNotUsed($event);
         $this->assertNotEmpty($event->get_name());
-        $this->assertStringContainsString('has locked the discussion', $event->get_description());
+        $this->assertStringContainsString(' locked the discussion:', $event->get_description());
 
         // Unset the lock.
         $sink = $this->redirectEvents(); // Capturing the event.
@@ -1971,7 +1971,7 @@ class externallib_test extends externallib_advanced_testcase {
         $this->assertEquals($context, $event->get_context());
         $this->assertEventContextNotUsed($event);
         $this->assertNotEmpty($event->get_name());
-        $this->assertStringContainsString('has unlocked the discussion', $event->get_description());
+        $this->assertStringContainsString(' unlocked the discussion:', $event->get_description());
     }
 
     /*
