itglue / powershellwrapper

This PowerShell module acts as a wrapper for the IT Glue API.
Apache License 2.0
120 stars 51 forks source link

Return Related Items from configurations / flexible assets #132

Open JamieGarryIT opened 3 years ago

JamieGarryIT commented 3 years ago

Currently you can set, create and delete flexible assets. Problem is only create works as for setting and deleting you need the ID of the related item you create which currently can not be got from what I see. To get this ID we will have to index / show related items on a configuration

This means while I can create relations I can't change the relation / delete it or check if there is already one there to stop duplication. Currently every time you create a related item it duplicates it within ITGlue.

I was speaking with Kaseya and the recommended a GET request using: ?include=related_items You should be able to add a flag to the current get commands to configurations and flexible assets to include a method to GET request with the ?include=related_items parameter at the end which should bring back the information required.

I've taken a look at the help and trawled through the code to no avail of this function so if it's there and I've missed it I do apologize.

Thanks for creating this wrapper ! :D

ecspresso commented 3 years ago

As Kaseya support told you, all get requests for related items as to be done when asking for the asset.

https://api.itglue.com/developer#related-items:

Note that related items (including those created from a Tag field) are accessed from the relevant endpoints (GET /configurations, GET /passwords, etc.) using the include=related_items parameter to return the related items in the relationships attributes of the requested objects.

@adrianwells @CalebAlbers I think it would be a good idea to implement ?include=related_items as a parameter. This could be done at the same time as #12, because all API calls needs to be updated anyway.