Insight IQL using current objects attribute to filter available referenced objects

Andrej Freeze _ greenique
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.
February 13, 2018

I have two types of objects. Elements and Options 

Options have an outboundReference can be chosen by to various different Elements

Now I would like to be able to select an Option in my Element's Attribute called "Chosen Option". The options given should be narrowed down to the Options that have an outboundReference to the current object.

Is there any way to achieve this?

I had a few IQL's that ended up in errors while searching for an answer and looked through the documentation without success.

image.png

2 answers

1 accepted

2 votes
Answer accepted
Tobias February 1, 2019

Hi Andrej,

today I faced a very similar challenge compared to your request. Just to explain in short: we have an Object Type OSPlatform. The OSPlatform is referenced from two other ObjectTypes: Configuration and Computer. Configuration and Computer are referenced by a fourth ObjectType called ServerControl.

The idea was to limit the Configurations attachable to ServerControl according to the OSPlatform defined at the Computer object.

I used the following filter for the attribute Configurations at ServerControl:

object HAVING outboundReferences(objectType = "OSPlatform" AND object HAVING inboundReferences(objectType = "Computer" AND Name = ${Device}))

 

Ok, what does that mean? I try to express it clearly. Select all Configurations having outbound references to an ObjectType OSPlatform. But not every OSPlatform is valid. So we have to be more specific and just select OSPlatforms with inbound references from Object Type Computer. But not every Computer is valid. It has to be a Computer with the same Name as the Device referenced to the actual object, which is ServerControl. So in this case we need the Placeholder ${Device}.

 

Not sure if I explained that in a Crystal clear way. Hope it helps. If you have any further questions do not hesitate to contact me.

Regards,

Tobias

Juri Ahokas November 24, 2020

Good explanation. Thanks. 

0 votes
Alexander Sundström
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.
February 15, 2018

Hi Andrej,

This should be possible, but remember that it will only work when editing object, not when creating new ones.

You would need a combination of IQL and placeholders which you can read about att

I think that adding IQL to the attribute Chosen Option under it's configuration and setting it to something like this should have the effect you want:

object HAVING inboundReferences(Key = ${can be chosen by${0}})

Is can be chosen by the reference type or the attribute name?  What should be used in the above example is the attribute name.

There is also a video demonstrating how to set the IQL up using placeholders at https://www.youtube.com/watch?time_continue=2&v=u_SfRBKJOJY Perhaps that can be of help :)

Best Regards
Alexander

Andrej Freeze _ greenique
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.
February 16, 2018

Hey Alexander,

this looks like a splendid solution. However as I tried to implement it, there were always zero results. I think this is getting close to what we are searching for.

I was able to narrow it down as follows

Element Attributes:

Bildschirmfoto 2018-02-16 um 10.26.02.png

 

Option Attributes:

Bildschirmfoto 2018-02-16 um 10.26.18.png

 

Now when I try to have all Options for the Servicelement ASE, it works if i have a quite simple IQL Filter for attribute Serviceoptionen like this one

Servicelement = "ASE"

If i change it to a placeholder it does not work anymore

Servicelement = ${Name}

It seems to me like I am make some sort of fundamental mistake here but as far as I understood this should work just fine.

 

Thanks in advance

Andrej

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events