---
schema_version: "1"
id: 47417ecd3e8c3e95e3c0910656dc9f2c12a13e678e312738fbcd64321b4c3e43
title: devops promote
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/devops/cli_reference_devops_promote.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_devops_promote.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0168599a71cdf80cf6c5917ab0a961905f288e024d1a6c80addb6d2641ac87ee
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# devops promote

Promote work items or a pipeline stage to a target pipeline stage.

## Description for devops promote

Promote specific work items or all approved work items from a source stage to the target pipeline stage.

Pass --work-item-id to promote one or more specific work items to the target stage.

Pass --stage-id to promote all approved work items from that source stage to the target stage.

Exactly one of --work-item-id or --stage-id must be provided.

Use --deploy-all to deploy all metadata in the branch rather than only changes not yet in the target stage.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;api&#8209;version</code> | N/A | **Type:** Value<br><br>Override the api version used for api requests made by this command |
| <code>&#8209;&#8209;deploy&#8209;all</code> | <code>&#8209;a</code> | **Type:** Boolean<br><br>Deploy all metadata in the branch to the stage's org.<br><br>If you don’t specify this flag, only changes in the stage’s branch are deployed. |
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |
| <code>&#8209;&#8209;skip&#8209;validation</code> | N/A | **Type:** Boolean<br><br>Skip pre-promote validation. By default, promotion is validated before proceeding to prevent promoting work items without an associated PR. Use this flag to bypass validation. |
| <code>&#8209;&#8209;stage&#8209;id</code> | <code>&#8209;s</code> | **Type:** Value<br><br>ID of the source pipeline stage whose approved work items will be promoted. Mutually exclusive with --work-item-id. |
| <code>&#8209;&#8209;target&#8209;org</code> | <code>&#8209;o</code> | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |
| <code>&#8209;&#8209;target&#8209;stage&#8209;id</code> | <code>&#8209;t</code> | **Type:** Value<br>**Required**<br><br>ID of the pipeline stage to promote to. |
| <code>&#8209;&#8209;test&#8209;level</code> | <code>&#8209;l</code> | **Type:** Value<br>**Valid Values:** `NoTestRun`, `RunSpecifiedTests`, `RunLocalTests`, `RunAllTestsInOrg`<br><br>Deployment Apex testing level.<br><br>Valid values are:<br><br><ul><li>NoTestRun — No tests are run. This test level applies only to deployments to development environments, such as sandbox, Developer Edition, or trial orgs. This test level is the default for development environments.</li><li>RunSpecifiedTests — Runs only the tests that you specify with the --tests flag. Code coverage requirements differ from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75% code coverage for each class and trigger in the deployment package. This coverage is computed for each class and trigger individually and is different than the overall coverage percentage.</li><li>RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked packages. This test level is the default for production deployments that include Apex classes or triggers.</li><li>RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.</li></ul><br><br>If you don’t specify a test level, the default behavior depends on the contents of your deployment package. For more information, see the section "Running Tests in a Deployment" in the "Metadata API Developer Guide". (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_running_tests.htm) |
| <code>&#8209;&#8209;tests</code> | N/A | **Type:** Value<br><br>Apex tests to run when --test-level is RunSpecifiedTests.<br><br>Separate multiple test names with commas. Enclose the entire flag value in double quotes if a test name contains spaces. |
| <code>&#8209;&#8209;work&#8209;item&#8209;id</code> | <code>&#8209;i</code> | **Type:** Value<br><br>ID of the work item to promote. Mutually exclusive with --stage-id.<br><br>Specify this flag multiple times to promote multiple work items in a single operation. |

## Examples for devops promote

Promote all approved work items from a source stage to a target stage:

```shell
sf devops promote --target-org my-devops-org --stage-id 1QVxx0000000001 --target-stage-id 1QVxx0000000002
```

Promote a specific work item to a stage:

```shell
sf devops promote --target-org my-devops-org --work-item-id 1fkxx0000000001 --target-stage-id 1QVxx0000000001
```

Promote multiple work items:

```shell
sf devops promote --target-org my-devops-org --work-item-id 1fkxx0000000001 --work-item-id 1fkxx0000000002 --target-stage-id 1QVxx0000000001
```

Promote a stage with full deploy:

```shell
sf devops promote --target-org my-devops-org --stage-id 1QVxx0000000001 --target-stage-id 1QVxx0000000002 --deploy-all
```
<!-- prettier-ignore-end -->
