{"action":"created","issue":{"url":"https://api.github.com/repos/sheagcraig/JSSImporter/issues/27","labels_url":"https://api.github.com/repos/sheagcraig/JSSImporter/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/sheagcraig/JSSImporter/issues/27/comments","events_url":"https://api.github.com/repos/sheagcraig/JSSImporter/issues/27/events","html_url":"https://github.com/sheagcraig/JSSImporter/issues/27","id":57605351,"number":27,"title":"How to scope differently","user":{"login":"charliwest","id":7933076,"avatar_url":"https://avatars.githubusercontent.com/u/7933076?v=3","gravatar_id":"","url":"https://api.github.com/users/charliwest","html_url":"https://github.com/charliwest","followers_url":"https://api.github.com/users/charliwest/followers","following_url":"https://api.github.com/users/charliwest/following{/other_user}","gists_url":"https://api.github.com/users/charliwest/gists{/gist_id}","starred_url":"https://api.github.com/users/charliwest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charliwest/subscriptions","organizations_url":"https://api.github.com/users/charliwest/orgs","repos_url":"https://api.github.com/users/charliwest/repos","events_url":"https://api.github.com/users/charliwest/events{/privacy}","received_events_url":"https://api.github.com/users/charliwest/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-13T14:35:09Z","updated_at":"2015-02-13T15:07:42Z","closed_at":null,"body":"I am trying to set up a fairly fully automated system using this and autoupdate magic. I have hit a bit of a stumbling block though.\r\nI will try and explain fully further down my flow, but in short I would like to have override recipes that make an install policy triggered by autoupdate-%PROD_NAME% scoped to a smart group, something like update-%PROD_NAME%-Real, but in the PolicyTemplate.xml for scope it says is added by JSSImporter. So basically how do I create the policy with a different scope?\r\n\r\nLonger flow example is:-\r\nAutoPkg with JSSImporter updates Firefox, smart group is created 'Firefox-update-smart', this has one criteria that they are part of the static group 'Testing', policy is created to install via self service, scoped to  'Firefox-update-smart'.\r\nThen I would like my testers to install it, report back all is good, then someone runs a script to say 'make real Firefox'. This then calls AutoPkg with JSSImporter to run the policy making part again, but this time with different templates 'SmartGroupReal.xml' and 'PolicyReal.xml' but the policy still scopes to testing"},"comment":{"url":"https://api.github.com/repos/sheagcraig/JSSImporter/issues/comments/74267245","html_url":"https://github.com/sheagcraig/JSSImporter/issues/27#issuecomment-74267245","issue_url":"https://api.github.com/repos/sheagcraig/JSSImporter/issues/27","id":74267245,"user":{"login":"sheagcraig","id":3568072,"avatar_url":"https://avatars.githubusercontent.com/u/3568072?v=3","gravatar_id":"","url":"https://api.github.com/users/sheagcraig","html_url":"https://github.com/sheagcraig","followers_url":"https://api.github.com/users/sheagcraig/followers","following_url":"https://api.github.com/users/sheagcraig/following{/other_user}","gists_url":"https://api.github.com/users/sheagcraig/gists{/gist_id}","starred_url":"https://api.github.com/users/sheagcraig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheagcraig/subscriptions","organizations_url":"https://api.github.com/users/sheagcraig/orgs","repos_url":"https://api.github.com/users/sheagcraig/repos","events_url":"https://api.github.com/users/sheagcraig/events{/privacy}","received_events_url":"https://api.github.com/users/sheagcraig/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T15:07:42Z","updated_at":"2015-02-13T15:07:42Z","body":"That sounds correct to me.\r\n\r\nYour second comment seems to indicate you're on the track of taking a policy that allows testers to install a package, run a script  to update the policy, and then the same policy is scoped to a different, broader group.\r\n\r\nThe problem I foresee with that approach is that when the next update comes out, it knocks out the scope that is delivering the software to your broader users and replaces it with the testing scope again. And it's a self-service policy, so it wasn't automatically distributed.\r\n\r\nI would think that just having two policies would be best (and maybe I'm misinterpreting your design above). One for testing, that just constantly has the newest version, and then the production one.\r\n\r\nIn terms of autopkg, you could, in your release (I call it \"promotion\") script, *use* the package that is already up there.\r\n\r\nI wrote a utility called jss_helper to do this manually for me, but it could be turned into an automated thing. You just feed it the package ID of the old package, the new package, and the policy, and it does all of the swapping around. If the numbers don't make sense it bails.\r\n\r\nThe only problem is that you have to manually flush the policy logs if you're using a \"Once per computer\" install frequency, but that can be solved with the scope (and it sounds like you have a good plan for that)."}}