---
schema_version: "1"
id: 5558ab6ea2b0930f4c0ec0ea5fd6943f6add23701e1ed763ccd08c42cf5ac91e
title: devops promotion complete
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/devops/cli_reference_devops_promotion_complete.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_devops_promotion_complete.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a6cd221cc852355ee78b07d7909412ab7774ed9922b32b84c5044893f04b5a2f
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# devops promotion complete

Deploy undeployed work items to a pipeline stage org.

## Description for devops promotion complete

Deploys work items that were merged into the pipeline branch outside of DevOps Center (externally merged) into the target stage org and updates DevOps Center records. Equivalent to the "Complete Promotion" action in the DevOps Center UI when a stage is out of sync.

If no undeployed work items are found for the stage, the command exits successfully with no action taken.

## 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;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 out-of-sync pipeline stage to deploy 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 a specific work item to deploy. Omit to deploy all undeployed work items for the stage. Use this for the first stage of a pipeline where no source stage exists. |

## Examples for devops promotion complete

Complete a promotion for an out-of-sync pipeline stage:

```shell
sf devops promotion complete --target-org my-devops-org --target-stage-id 1QV000000000001
```

Complete a promotion for a specific work item (e.g. first stage of a pipeline):

```shell
sf devops promotion complete --target-org my-devops-org --target-stage-id 1QV000000000001 --work-item-id 1fk000000000001
```

Complete a promotion with full deploy and a specific test level:

```shell
sf devops promotion complete --target-org my-devops-org --target-stage-id 1QV000000000001 --deploy-all --test-level RunLocalTests
```
<!-- prettier-ignore-end -->
