Categorize Apps

bvondeylen
Contributor II

I like to have an orderly JSS for Mobile Apps. I would like every single app to be in a Category so Self Service is organized as well.

When new apps are acquired, they appear in the "No Category Assigned" category. That is a good way of knowing after acquiring an App from VPP that it is now available to assign in our JSS. So I place it in a category. That is all going fine.

This summer, we moved our test 'eSpark' school from their MDM to JAMF and our JSS. Around 500 apps were moved as well (all Uncategorized). So now my JSS is a mess and the only way I can tell to correct it is to open each app individually and select the eSpark category. Doing this just 10 times takes almost 30 minutes. This is so unbearably tedious and slow.

I am hoping someone can tell me there is a better way.

Like checking a box in a list of the apps and moving a batch from category: none to category: eSpark.

Please?

1 REPLY 1

bburdeaux
Contributor II

Are you assigning them to a JSS category or just a Self Service category?

If you're using JSS categories, and you can compile a list of app IDs that you need to change, you can make the change in the API. Example script:

#!/bin/sh

TARGET = /Path/to/list.csv
CATEGORY = [category ID number]

cat $TARGET | while read APP; do
curl -sk -u api:api -H "Content-Type: text/xml" -d "<?xml version="1.0" encoding="ISO-8859-1"?><mobile_device_application><general><category><id>$CATEGORY</id></category></general></mobile_device_application>" https://casper.dpisd.org:8443/JSSResource/mobiledeviceapplications/id/$APP -X PUT
done

One easy way to generate the list of apps not in a category, is to run the following SQL query on your database and dump that to a csv.

select mobile_device_app_id from mobile_device_apps where category_id = -1 and deleted = 0;

If you're using Self Service categories, the solution will be a bit more complicated since you can't easily use the API to add Self Service categories. I don't have a solution for that on hand, but I'm sure I can track one down if you need it.