Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 for Jenkins Documentation | 1.17.3

# p4approve: P4 ApproveImpl Review

P4 Code Review required. Used to set the P4 Code Review review state when the build completes.

## Example p4approve: P4ApproveImpl Review configuration

### Example generated script for p4approve: P4 ApproveImpl Review

The form above generates the following script snippet:

    p4approve(
        credential: 'publicperforcecom1666',
        description: 'Updated by Jenkins. Build: ${BUILD_URL}',
        review: '${P4_REVIEW}',
        status: 'REVIEW'
    )

If you manually edit your script, remember to keep the single quotes that the snippet generator puts around the variables. Replacing them with full quotes " will expand the variables early and the script will fail. For more information about this, see Variable Expansion.

### Paste the script snippet into a basic script

Example: the script snippet above has been pasted into a basic script:

    pipeline {
        agent any
        stages {
            stage('SetReview') {
    			steps() {
    				// set review state to Needs Review when build complete
    				p4approve(
    					credential: 'publicperforcecom1666',
    					description: 'Updated by Jenkins. Build: ${BUILD_URL}',
    					review: '${P4_REVIEW}',
    					status: 'REVIEW'
    				)
    			}
            }
        }
    }

## Configure a p4approve: P4ApproveImpl Review script

1. To create a p4approve: P4 ApproveImpl Review script, select p4approve: P4 ApproveImpl Review from the Sample Step dropdown

2. Select the credentials for the project from the Perforce credentials dropdown.

- Perforce Credentials: Select the credentials for P4 Code Review from the Perforce credentials dropdown.
- Swarm Review: When the build is complete the status of this P4 Code Review review is set according to the value in the Approve Status field. Enter the P4 Code Review review ID number or a custom environment variable ${VAR}. For more information about environment variables, see Variable Expansion.
- Approve Status: Select the status to set the P4 Code Review review to when the build completes, options are: Needs Review, Needs Revision, Approve, Approve and Commit, Reject, Archive, Vote Up, or Vote Down.
- Description: Enter the text to add to the P4 Code Review review when its review status is changed. This is usually a mix of common text and one or more environment variables ${VAR}. For more information about environment variables, see Variable Expansion.

### Generate Pipeline Script

To generate the pipeline script, click Generate Pipeline Script. The script is generated in the text box below the button.

Copy the generated script and paste it into the Script box on the Jenkins Pipeline Script page.

Your search for returned results