• 0
Sign in to follow this  
Joe Williams

Rest Filter Device Group not set property

Question

We set a property on each customer folder to pass a code to our helpdesk software. If this property isn't set, a ticket can't be created.
So we put a default catch all property on the root folder. I am attempting to write a rest report so we can see which folders don't have the property set themselves.

 $queryParams = '?fields=customProperties,name,id&size=1000&sort=fullPath&filter=fullPath~Customers,customProperties.name:servicenow.companyid,customProperties.value:DefaultCODE';

My first attempt was match what folders have the default code applied to them. This didn't work, I am guessing because the property isn't truly applied to the folder as it is inherited. So how do I find folders that don't have the property directly applied to it?

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 1

Yup, customProperties object only has directly assigned props. 

What you do what are the inheritedProperties for the /device/devices API endpoint--

 $queryParams = '?fields=inheritedProperties,name,id&size=1000&filter=inheritedProperties.name:servicenow.companyid,inheritedProperties.value:DefaultCODE';

 

P.S. Thanks for bringing this up. I've been trying to find where the "aws.accountid" is grouped under and lo' and behold it's an inheritedProperty!

Edited by Joe Tran
clarification that this only works for resources and not resource groups

Share this post


Link to post
Share on other sites
  • 0

Well I got all excited, until I read your edit. :(

I guess I will just do it the hard way, dump the base groups with their properties and use PHP to loop through.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this