JS Rule rule.runRule, Error after Migration to 5.2.x

Hi,

maybe someone can help me with with the following migration issue. I have an text item that is changed to the uuid of a scene that should be called and a rule that should trigger the scene with the new item state

configuration: {}
triggers:
  - id: "1"
    configuration:
      itemName: System_startRule
    type: core.ItemCommandTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    label: löse die Szene aus
    configuration:
      type: application/javascript
      script: rules.runRule(event.itemCommand.toString(), {});
    type: script.ScriptAction

(this is f.e. also discussed here How to run scene from rule - #2 by jimtng)

This works fine on 5.1.4 but not on 5.2.x; the i get an error Failed to execute rule 'uuid' and wasn’t able to get more details.

I had seen a couple of changes for JS and Threads in the changelog, but it seems there is no migration guide for rules.RunRule(uuid, params) so i would expect this to work as before.

Any ideas?

Best regards

What version are you migraine from? IIRC, OH 5.1 was the version that normalized the event Object so it’s the same for both UI and file based rules. See JavaScript Scripting - Automation | openHAB.

It should be rules.runRule(event.receivedCommand, {}); or you need to turn off the event wrapper in the JS Scripting settings.

It also seems weird to do it this way. MainUI widgets can call times directly without needing to go through an Item. I’m not sure this roller is even needed.