It's all about the answers!

Ask a question

How to read Workspace UUID from build definition in Jenkins Pipeline?

Christian Ditscher (1324) | asked Nov 10 '16, 11:47 a.m.

in my Jenkins pipeline I want to read the Workspace UUID from a builddefinition.


How can I read that attribute inside a pipeline groovy script if I only know the name of the Build definition?


One answer

permanent link
Lakshmi Narasimhan T V (4415) | answered Nov 10 '16, 8:22 p.m.
In the pipeline script, this should be available as env.team_scm_workspaceUUID after the checkout step is over.

Christian Ditscher commented Nov 11 '16, 7:48 a.m.
teamconcert buildType: [value: 'buildWorkspace', buildWorkspace: WORKSPACE]
echo " env.team_scm_workspaceUUID is " +  env.team_scm_workspaceUUID


RTC Checkout : Fetching Completed
[Pipeline] echo
 env.team_scm_workspaceUUID is null


Lakshmi Narasimhan T V commented Mar 28 '17, 12:56 p.m.

 This is a known issue with pipeline build, if env is accessed before calling teamconcert, then any environment variables updated by the plugin is not visible.

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.