How to download source code by specific change set number in jenkins?

301 views Asked by At
node{
    stage('Source Control Management'){
    checkout([
        $class: 'TeamFoundationServerScm', 
        credentialsConfigurer: [
            $class: 'AutomaticCredentialsConfigurer'
        ],
        projectPath: '$/Onprem/Source/Service',
        serverUrl: 'http://abcd/',
        useOverwrite: true,
        useUpdate: true,
        workspaceName: 'Hudson-${JOB_NAME}-${NODE_NAME}'
    ])
    }
}

This pipeline script checkout the latest code whose chain set no is: 921 I want the pipeline to checkout only the previous code with chain set no: 917 What to do?

1

There are 1 answers

1
Ian W On

The plugin README says this available and describes how to do it for a Freestyle job:Use a versionspec argument to specify affected versions of items. Confirmed this works in a Freestyle job, but not a pipeline. Also, only works if supplied a Build Parameter, not as a regular parameter; odd.