PackagePushJob

Represents an individual push job for upgrading a package in an org from one version to another version. There can be multiple push jobs created for one push request. For example, if you want to upgrade five orgs as part of one push, you have one PackagePushRequest record and five PackagePushJob records.

Introduced in API version 36.0.

create(), describeSObjects(), query(), retrieve(), update(), upsert()

  • To initiate a push upgrade for a first-generation managed package, the Upload AppExchange Packages user permission is required.
  • To initiate a push upgrade for an unlocked or second-generation managed package, the Create and Update Second-Generation Packages user permission is required.
  • The push upgrade feature is only available to first- and second-generation managed packages that have passed AppExchange security review. To enable push upgrades for your managed package, log a support case in the Salesforce Partner Community.
  • For unlocked packages, push upgrades are enabled by default.
  • Type: int
  • Properties: Group, Nillable
  • Introduced: API version 51.0
  • Description: The length of time in seconds, that the push upgrade took to complete. This field is new in API version 51.0.
  • Type: datetime
  • Properties: Create, Nillable, Update
  • Introduced: API version 51.0
  • Description: The date and time (UTC) at which the push upgrade ended, in ISO 8601 format. This field is new in API version 51.0.
  • Type: boolean

  • Properties: Defaulted on create, Group

  • Introduced: API version 63.0

  • Default value: false

  • Type: reference
  • Properties: Create, Filter, Group, Nillable, Sort, Update
  • Description: Required. The ID of the parent push request record that must have been created.
  • Relationship name: PackagePushRequest
  • Relationship type: relationship
  • Refers to: PackagePushRequest
  • Type: datetime
  • Properties: Create, Nillable, Update
  • Introduced: API version 51.0
  • Description: The date and time (UTC) at which the push upgrade started, in ISO 8601 format. This field is new in API version 51.0.
  • Type: picklist

  • Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort

  • Description:

    The status of the job. Valid values are:

    • Canceled
    • Created (default)
    • Failed
    • In Progress
    • Pending
    • Succeeded

    Don’t specify this value when you create the push job. The default value of Created is used.

  • Possible values:

    • Canceled — Canceled
    • Created (default) — Created (default)
    • Failed — Failed
    • In Progress — In Progress
    • Pending — Pending
    • Succeeded — Succeeded
  • Type: string
  • Properties: Create, Filter, Group, Nillable, Sort, Update
  • Description: Required. The organization key of the org where the package is upgraded. This references orgKey in PackageSubscriber.

Suppose that you want to push version 3.4.6 of your package to all orgs. You’ve already identified the orgs eligible for the upgrade by using MetadataPackageVersion and created the push request using PackagePushRequest. Now let’s write some code to create a push job for each eligible org.

This code sample uses the Web Services Connector (WSC).

Or, if you’re using REST API, submit a POST request to the PackagePushJob sObject endpoint, as in the following example. SOAP API is also supported. This example returns the push job ID (starting with 0DX) that is required to query the status of the job.

Checking the Status of a Push Job

To check the job status, simply query the Status field. For example:

Here’s an example in Java.

You can also continuously poll the job status until the job is done. The following Java example polls the status every 10 seconds.