Skip to content

Rule tasks cannot be emptied with the CLI

When using the CLI, it is impossible to empty a rule's task chain. Normally, this would be done by simply entering "" as the value for the chain. For example -s "" should empty the rule's post-tasks, but this currently does not work, and the task chain is left unchanged when doing so.

The problem seems to be caused by the omitempty clause on the task chain fields of the rule JSON object. As a result, when the task slice is empty, the field is simply ignored when marshaling to JSON. Consequently, in the absence of a task field in the JSON, the REST server just leaves the task chain unchanged (as it should).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information