Skip to content

[BUG] "If" condition not working with asset.compromised #1057

@waqeen

Description

@waqeen

Problem with report template. "If statement" with checking "if asset is compromised" and trying to filter out my output, e.g. make table only with compromised assets, use of {% if asset.compromised %} not working.
And also it has strange logic, cause if using this condition in usual text it presents blank output, like "statement is false", but in case from example doesnt make empty table, it shows all of assets, like if each one is compromised, like "statement is true"

To Reproduce
Steps to reproduce the behavior:

  1. Create new case and add some assets with different compromised statuses
  2. Add any report template, that goes with {%for asset in assets%} or {%tr for asset in assets%} use this condition {% if asset.compromised %} example {% endif %} {% endfor %}
  3. Generate report from case with this template
  4. See that condition doesnt work

Expected behavior
Correct process with if condition

IRIS server version:
v2.4.22

Additional context
I used this statement from your wiki, and also from demo report template for investigation. Cause in Reports section in wiki small piece of information how to work with conditions in iris report templates,.
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions