Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48847

tfs_changeset not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • tfs-plugin
    • None
    • tfs_plugin version 5.126.0
      jenkins version 2.75

      Using Jenkins pipeline job, I am trying to print the TFS_CHANGESET but I get {{null }}

      I also notice environment variables TFS_WORKSPACE / TFS_WORKFOLDER / TFS_PROJECTPATH / TFS_SERVERURL / TFS_USERNAME show "null" as well.

      example code:

      import hudson.plugins.tfs.TeamFoundationServerScm
      node {
        serverUrl = "http://SERVERNAME:8080/tfs/ORG"
        projectPath = "\$/DigitalPlatforms/Syndication/Dev"
          try {
              deleteDir()
              stage 'download-from-scm'
              def workspace = pwd() + '/' + "Hudson-testingtfs-MASTER"
              ws("/var/lib/jenkins/testing/testingtfs" + '/' + "Hudson-testingtfs-MASTER") {
              def out = checkout changelog: false, poll: false, scm: [$class: 'TeamFoundationServerScm', credentialsConfigurer: [$class: 'AutomaticCredentialsConfigurer'], projectPath: "${projectPath}", serverUrl: "${serverUrl}", useOverwrite: true, useUpdate: true, workspaceName: 'Hudson-${JOB_NAME}-${NODE_NAME}']
      
      echo "${workspace}/${env.TFS_CHANGESET}"  //null for TFS_CHANGESET
      echo "${env.TFS_CHANGESET}"  //null
      }
              } catch (err) {
                   currentBuild.result = 'FAILED'
                   throw err
                   }
      }
      

            jpricketmsft Jason Prickett
            rshetty Roshan Shetty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: