Skip to content

[🐛 Bug]: Keep's keep.dictget() function parsing has an issue #5302

Description

@dvora-ns

Describe the bug
When a workflow using keep.dictget('{{alert}}', 'some_field', 'unknown') function is run on the alert with description="Hello ('Hola') everyone. How are you all doing?", the workflow fails. Tried using double quotes around the dictget params but it didn't work.

To Reproduce
Steps to reproduce the behavior:

  1. Add an alert with the mentioned description
  2. Add a workflow with the following configuration
    steps:
    • name: console-step
      provider:
      type: console
      config: "{{ providers.default-console }}"
      with:
      message: keep.dictget('{{alert}}', 'some_field', 'unknown')
  3. Execute the workflow on the inserted alert

Expected behavior
The workflow should run successfully.

Screenshots

Image Image

Root cause:
The issue is originating from here: https://github.com/keephq/keep/blob/main/keep/iohandler/iohandler.py#L96
The substring ') is causing the issue because when it processes the quote, keep considers it as terminating character.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions