PixarAnimationStudios / ruby-jss

ruby-jss provides native ruby access to the REST APIs of Jamf Pro, an enterprise/education tool for managing Apple devices, from jamf.com. The Jamf module provides access to both APIs. Jamf Pro objects are implemented as classes and interact with each other. Authentication tokens, data format and other details are handled under the hood to allow simpler, intuitive automation of Jamf-related tasks.
http://pixaranimationstudios.github.io/jss-api-gem/index.html
Other
97 stars 30 forks source link

MobileDeviceApplication always appears in Self Service even when in_self_service=false #102

Open carolinebeauchamp opened 1 month ago

carolinebeauchamp commented 1 month ago

When creating a new MobileDeviceApplication, even when in_self_service is set to false, the app is created as "In self service" and the self service tab appears in Jamf.

Looking at the XML applied, deployment_type is set to Install Automatically/Prompt Users to Install, and this is applied successfully with no errors.

What appears to be missing is the deploy_automatically attribute being included and set to true - I hacked this into the code and that made the app appear in the right place.

I don't, however, know how that will affect all the other types of self-servable objects, as this code is shared between them all.

glenfarclas17 commented 1 month ago

Thanks for the report! I'll dig into it and let you know if I need more info. You can thank Jamf for the PITA inconsistencies in how things deal with Self Service in the Classic API - I've sent them long rants about it in the past ;-)

Also, congrats on submitting on the 10-year anniversary of ruby-jss being open-source!

Cheers, -Chris

glenfarclas17 commented 1 month ago

Hi Caroline,

Can you send me the changes you made to fix things on your end? That'll speed up my process, and I can probably just integrate them, making sure all the other SelfServable objects behave properly.

Thanks! -Chris

carolinebeauchamp commented 1 month ago

Hi Chris,

Yay! 10 years, amazing 🍰 I yes, I thank Jamf every day for their wonderful API with it's extensive and detailed documentation! Spent many days recently with that joy ;)

I added in

in_ss_section_xml.add_element("deploy_automatically").text = "true"

in self_servable.rb at line 859 (def add_in_self_service_xml(doc_root))

Like I said, very hacky to proof of concept it. Not quite sure how to implement it across all the different object types in a less hacky way :(

Thanks

Caroline