How can i get the workspace path in jelly email-ext template using pipeline

The below code use to work when we run it from a freestyle project, but now we are moving the project as a pipeline and it is not working anymore.

Jelly Template:

<j:choose>
      <j:when test="${line.contains('Failed test text')}">
        Testcase failed when running Failed test text<BR/>
        <j:set var="xmlFilePath" value="${build.getWorkspace()}/Tests/TestResults.xml"/>
        <util:file name="${xmlFilePath}" var="xmlFileContent"/>
        <x:parse var="TextResults" xml="${xmlFileContent}"/>
        <x:set var="JmeterTestResults" select="$TestResults/testResults"/>
        <x:forEach var="testcaseResult" select="$TestResults/httpSample">
          <x:forEach var="assertionResults" select="$testcaseResult/assertionResult">
            <j:set var="name"><x:expr select="$assertionResults/name"/></j:set>
            <j:set var="failure"><x:expr select="$assertionResults/failure"/></j:set>
            <j:if test="${failure.equals('true')}">
              <j:set var="failureMessage"><x:expr select="$assertionResults/failureMessage"/></j:set>
              ${name}<BR/>
              ${failureMessage}
            </j:if>
          </x:forEach>
        </x:forEach>
      </j:when>
</j:choose>

I found that the reason is that running as a pipeline the ${build.getWorkspace()} is not working anymore, and alternatively i can use ${env.WORKSPACE}, however also noticed that “env” variables are also not visible for in the jelly side. Also used "${ENV, "var=WORKSPACE"}" and it does not work too.

In my project once the testing executing is leaving fails descriptions upon some .xml files that i use to collect and display in the notification e-mail.

How can i get now the workspace path ? Any ideas ?

This should be

${ENV, var="WORKSPACE"}

Same i’m getting JellyException: Could not parse Jelly script : null

A pipeline without a node block has no workspace, a pipeline that uses several node blocks has many workspaces.
I wonder how this has worked for freestyle projects when the build runs on an agent and not the controller.
${ENV, var="WORKSPACE"} can’t work because it only provides a string. But build.getWorkspace() returns a FilePath object that grants access to the workspace on a remote agent. And if I understand it the jelly of the template is evaluated on the controller.