-
Suggestion
-
Resolution: Unresolved
-
None
-
3
-
2
-
Issue Summary
Insight REST API does not fetch Inbound references. Only Outbound references are retrievable.
REST API mentions referenced object in the Response section, but only works for Outbound references.
Steps to Reproduce
- Create 3 object Types, for example:
- Servers
- Application
- Location
- In Server object type, create an outbound reference to Location object Type
- In Application object Type, create an attribute 'Server', Type Object pointing to Servers object type
- Create some dummy objects
- Use either of the following REST API
/rest/insight/1.0/iql/objects?objectSchemaId={id}&iql=objectType=Servers /rest/insight/1.0/iql/objects?objectSchemaId={id}&includeAttributesDeep=2&iql=objectType=Servers
Expected Results
Inbound and outbound reference should be fetched.
Actual Results
Only outbound reference are fetched.
Nothing about Inbound references.
Workaround
1) Use an IQL to find all inbound referenced Objects.
However, if there are many Server objects, it will be required to call REST API as many times as objects are which could be an issue
The IQL would look like the following:
{{host}}:{{port}}/rest/insight/1.0/iql/objects?objectSchemaId={id}&iql=object HAVING outR(Key = {ServerKey})
2) Server object Type could have an outbound reference to Application object type, but we are storing the same data in multiple objects which is not very efficient.
- links to
- mentioned in
-
Page Failed to load
This is not a bug, hence moved it to Suggestion:
the API works as expected, and the Workaround mentioned is the valid way to get inbound references, as inbound references are not noted on an object, but they are outbound references of other objects.
The current syntax (Jira 10.0.0), to get an object (Key=ABC-123) and its inbound references (from ANY schema):
{{URL}}/rest/assets/latest/aql/objects?qlQuery=Key = ABC-123 OR object HAVING outR(Key = ABC-123)