Skip to content

Conversation

@cybertunnel
Copy link
Contributor

This PR should fix the bug outlined in #66 where the smart group wouldn't properly update and throw a 409.

The changes made:

  • Provided empty computer payload to ensure no conflicts

Details:
The Jamf Pro API assumes you want the same computers included in the group if you don't specify the <computers><computer /></computers> section of the XML payload. This is why we get a 409 since one or more computers in the group might not be assigned to the site the group is being moved to.

Copy link
Contributor

@glenfarclas17 glenfarclas17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya Tyler!
I'm finally looking at all of your pending merges.

This one is a problem, cuz you're adding a 'computer' element in the parent class of all groups, which might be a MobileDeviceGroup or a UserGroup.

The way I'd do it is:

group.add_element(self.class::MEMBER_CLASS::RSRC_LIST_KEY.to_s).text = nil

self.class::MEMBER_CLASS::RSRC_LIST_KEY.to_s should return 'computers', 'mobile_devices', or 'users' as appropriate for the Group subclass being used.

Cheers,
-Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants