Skip to content

rule with operator "matches" is not working #12

@rajasekarshanmugam

Description

@rajasekarshanmugam

i tried a simple condition of using "matches" as a condition, however it failed to work. below is the sample data used. it fails to match.

data snippet:

{
 "subject": "Invoice - id"
}

rule snippet:

{
        "field": "subject",
        "operator": "matches",
        "value": "Invoice.*"
}

in evaluator.js, it looks like the matches and not matches implementation, is using the criteria and constraint in reverse. correct condition looks like below.

        case "matches":
            return new RegExp(constraint.value).test(`${criterion}`);

or am i using it differently?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions