Skip to content

targetedOSVersionsRule

Erik Gomez edited this page Aug 24, 2021 · 24 revisions

As Nudge continues to be used in organizations, more complex nudge events will occur. targetedOSVersionsRule is a new key for Nudge v1.1.0 and higher, allowing you to have multiple nudge events concurrently.

Precedence of rules

Rules take the following precedence:

  • Full OS Match
    • Device is running 11.5.1
    • targetedOSVersionsRule value is 11.5.1
  • Major OS Match
    • Device is running 11.5.1
    • targetedOSVersionsRule value is 11
  • Default Match
    • Device is running 11.5.1
    • targetedOSVersionsRule value is default or targetedOSVersionsRule key is not present

Warning of undefined behavior

Passing identical rules will result in "undefined" behavior. Currently, the last identical rule will be honored.

Bad examples

In this example, you have two "default" rules, one being explicitly defined with targetedOSVersionsRule and one without the key. The device will have an effective requiredInstallationDate of 2021-07-30T00:00:00Z

{
  "osVersionRequirements": [
    {
      "aboutUpdateURL": "https://apple.com",
      "requiredInstallationDate": "2021-08-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2"
    },
    {
      "aboutUpdateURL": "https://apple.com",
      "requiredInstallationDate": "2021-07-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2",
      "targetedOSVersionsRule": "default"
    }
  ]
}

In this example you have two Major OS Match rules. The device will have an effective requiredInstallationDate of 2021-07-30T00:00:00Z

{
  "osVersionRequirements": [
    {
      "aboutUpdateURL": "https://apple.com",
      "requiredInstallationDate": "2021-08-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2",
      "targetedOSVersionsRule": "11"
    },
    {
      "aboutUpdateURL": "https://apple.com",
      "requiredInstallationDate": "2021-07-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2",
      "targetedOSVersionsRule": "11"
    }
  ]
}

Singular Nudge event

If you are only deploying a single Nudge event, the configuration is quite simple

{
  "osVersionRequirements": [
    {
      "aboutUpdateURL": "https://apple.com",
      "requiredInstallationDate": "2021-07-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2"
    }
  ]
}

An alternative configuration which is technically identical

{
  "osVersionRequirements": [
    {
      "aboutUpdateURL": "https://apple.com",
      "requiredInstallationDate": "2021-07-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2",
      "targetedOSVersionsRule": "default"
    }
  ]
}

Multiple Nudge events

Real world example 1

You may find yourself in a situation where Apple releases a minor update that you want people to install, but it is not critical to the safety of your organization. 11.5.2 might be a perfect example of this.

If you find yourself in the middle of an active Nudge event, say 11.5.1, and a new version comes out, you may want to enforce 11.5.2 for anyone who hasn't installed 11.5.1 yet, while not punishing your users.

{
  "osVersionRequirements": [
    {
      "aboutUpdateURL": "https://support.apple.com/en-us/HT211896",
      "requiredInstallationDate": "2021-09-15T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2",
      "targetedOSVersionsRule": "11.5.1"
    },
    {
      "aboutUpdateURL": "https://support.apple.com/en-us/HT211896",
      "requiredInstallationDate": "2021-08-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2"
    }
  ]
}

Real world example 2

With the imminent release of macOS Monterey, you may want a minimum OS version for both Big Sur and Monterey.

{
  "osVersionRequirements": [
    {
      "aboutUpdateURL": "https://support.apple.com/en-us/HT211896",
      "requiredInstallationDate": "2021-08-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2",
      "targetedOSVersionsRule": "11"
    },
    {
      "aboutUpdateURL": "https://www.apple.com/macos/monterey-preview/",
      "requiredInstallationDate": "2021-10-30T00:00:00Z",
      "requiredMinimumOSVersion": "12.0.1",
      "targetedOSVersionsRule": "12"
    }
  ]
}

Deploying a configuration that is compatible with both v1.0.0.x and v1.1.0.x

In order to have a configuration that can work with all current versions of Nudge, your primary Nudge event must be the first dictionary of your osVersionRequirements key.

Good example

{
  "osVersionRequirements": [
    {
      "aboutUpdateURL": "https://apple.com",
      "requiredInstallationDate": "2021-07-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2",
      "targetedOSVersions": [
        "11.0",
        "11.0.1",
        "11.1",
        "11.2",
        "11.2.1",
        "11.2.2",
        "11.2.3",
        "11.3",
        "11.3.1",
        "11.4",
        "11.5",
        "11.5.1"
      ],
      "targetedOSVersionsRule": "default"
    },
    {
      "aboutUpdateURL": "https://apple.com",
      "requiredInstallationDate": "2021-08-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2",
      "targetedOSVersionsRule": "11.5.1"
    }
  ]
}

Bad example

{
  "osVersionRequirements": [
    {
      "aboutUpdateURL": "https://apple.com",
      "requiredInstallationDate": "2021-08-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2",
      "targetedOSVersionsRule": "11.5.1"
    },
    {
      "aboutUpdateURL": "https://apple.com",
      "requiredInstallationDate": "2021-07-30T00:00:00Z",
      "requiredMinimumOSVersion": "11.5.2",
      "targetedOSVersions": [
        "11.0",
        "11.0.1",
        "11.1",
        "11.2",
        "11.2.1",
        "11.2.2",
        "11.2.3",
        "11.3",
        "11.3.1",
        "11.4",
        "11.5",
        "11.5.1"
      ],
      "targetedOSVersionsRule": "default"
    }
  ]
}
Clone this wiki locally