Insight IQL comparing two attribute values

Mohannad Alghaslan November 13, 2018

Hi,

 

I'm trying to set up an automation rule that sends alerts when an attribute integer value is set to a value less than that of another attribute. For example, item's "available stock" and "stock alert threshold", and whenever the value of "available stock" falls beneath the threshold value and e-mail will be sent.

 

The IQL ("available stock" <= "stock alert threshold") returns nothing, but if I write ("available stock" <= 10) the IQL works.

 

Could it be that Insight doesn't support comparing two attribute values?

 

Thanks!

Mohannad

1 answer

1 accepted

0 votes
Answer accepted
Yinon Negev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 13, 2018

Hi Mohannad.

    The Automation Condition (IF) uses an IQL statement, which does not support placeholders to replace the Value of an Attribute.

I would like to recommend you to visit https://jira.riada.io which is our open ticket system for feature requests and verified bugs. You can view, watch, vote and comment on issues reported by anyone.

If you can't find an already opened ticket request for this feature, feel free to create a new one.

Your first query is trying to match an Attribute Value (in the Attribute "Available Stock") against the string "stock alert threshold" hence - it fails. (e.g. 7 <= "stock alert threshold" ), while your second statement is validating an Attribute Value against a Value; 7 <= 10 -->>>True

If placholders were supported in the IQL, the statement should have been "Available Stock") <= ${stock alert threshold}

//  ${...} is a placholder for the Attribute Value //

At the moment, a way to resolve this is by having an Automation Rule to run a Groovy Script Action which will compare the Attributes' Values - and, either run the expected Groovy script if the condition is True, or, as an example, set a Boolean Attribute as a Flag, for another Automation Rule to pick up resulting in a different Action (When Object Updated, If objectType = "yourObjectType" AND "Below Stock Threshold" IS True, then.....

Kind regards,

Yinon

Team Riada 

Oliver Schalch January 3, 2020

Hi Yinon,

If have a short, similar question, by comparing it attributes if same or not. By our SCCM import we have Top console user and Primary user, and I want to check by a automation if there containing same object or not.

Here you see, that the attribute not same

screen1.png

and here is the attribute same:

screen2.png

So what we want in the End, if Top console user is not same as Primary user to send an E-Mail, Create a ticket or whatever. I didnt could make any IQL which was resulting correct.

Thanks

Oli

Yinon Negev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2020

Hi Oli. 

     For the case showing in your first screenshot - you can trigger an action with an IQL condition like:

("Top Console User" IS EMPTY AND "Primary User" IS NOT EMPTY) OR ("Top Console User" IS NOT EMPTY AND "Primary User" IS EMPTY)

However, if these two Attributes are NOT EMPTY (i.e populated) - then the only way available at the moment, to compare the two values, is by running a Groovy Script Action, which will also take care of sending an email / create a Ticket - if the Values do not match...

As noted here - there is currently no option, to compare two Attribute Values.

Cheers,

Yinon

Mindville support Team

Oliver Schalch January 7, 2020

Hi,

I'm new to groovy, and there is less documentation. Is there any documenation like a howto from scratch to work together with groovy and insight? The examples more confusing me on the documentation from insight :)

 

THanks

Like Jon Irusta likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events