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.
Hi

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

team.scm.workspaceUUID

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

Thanks


One answer



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

Comments
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

outpuis


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

</pre>
<br>

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

 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.