-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide join_queries that look through cmdb_rel_ci #54
Comments
looking at the schema you probably want something more like
|
Hey @vetsin thanks for your prompt answer ! I see in the documentation : so I don't think the |
honestly a join query is unlikely what you want here. I would recommend querying the individual tables - though I cannot help there as I'm wholly unfamiliar with CMDB. Seeing however as there is no issue with the API I'm going to close this - if there are particular data questions I suggest asking within the ServiceNow community |
For anyone having a similar problem I ended up solving this like this : gr = client.GlideRecord('cmdb_rel_ci')
gr.add_query('type.name', 'Owned by::Owns')
gr.add_query('parent.sys_class_name', 'cmdb_ci_server')
gr.add_query('child.sys_class_name', 'cmdb_ci_ip_address')
gr.fields = ['sys_id',
'parent.name',
'child.name',]
gr.query()
gr.serialize_all() I still think that a pythonic way of doing this would be nice. If I end up having a clean implementation in the project that I am developing I'll contribute it here, if you welcome such a contribution. |
I'm trying to extract data from two tables that are linked using
cmdb_rel_ci
. I was expecting to be able to add a join_query as described by https://servicenow.github.io/PySNC/user/advanced.html#join-queries but it seems that this is a functionality to query linked or dotwalked attributes (not sure how they are called in servicenow - reference field?) withjoin_table_field
.This is pseudo code I would like to be able to write :
Inspired by schema https://docs.servicenow.com/en-US/bundle/tokyo-servicenow-platform/page/product/configuration-management/concept/class-server.html
That would return records of
servers
with their relatedip_address
.Is this already possible with the existing code ?
The text was updated successfully, but these errors were encountered: