One more thing... in the script I posted here I'm calling the getActions... 
I've tried with both getActions and getAction.

I've also passed in the class as a string as in some examples 
online https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin with no 
success.



On Tuesday, June 3, 2014 10:32:10 AM UTC-4, Rob Lowe wrote:
>
> All,
>
> I am attempting to get access to the previous builds test results and 
> can't seem to in the jelly script I'm working with. I've tried numerous 
> different attempts at getting the TestResultAction object from the 
> Run.getAction method however I have been unsuccessful so far and hoped one 
> of you could shed some light on my issue. I've also used the getAllActions 
> method to see that there is indeed a TestResultAction on my previous build. 
> I've even got the TestResultAction successfully when I've used the 
> Run.getAllActions().get(*indexOfTestResultAction*). This has proven 
> successful but not reliable as it is not always in the same sequence build 
> after build.
>
> Here is an example script that I've been working with. If anyone has ideas 
> or clues as to why this isn't working for me please let me know. In the 
> example I have below the testAction1 variable I define is always NULL.
>
> Thanks!
>
> <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" 
> xmlns:d="jelly:define">
> <BODY>
>
> <j:set var="previousBuild1" value="${build.getPreviousBuild()}" />
> <j:if test="${previousBuild1!=null}">
> PREVIOUS BUILD1 IS NOT NULL
> <j:set var="allActions" value="${previousBuild1.getAllActions()}" />
>
> <j:if test="${allActions!=null}">
>
> ACTIONS IS NOT NULL ${allActions}
>
>
> <j:set var="testAction1" 
> value="${previousBuild1.getActions(hudson.tasks.junit.TestResultAction.class)}"
>  
> />
> <j:if test="${testAction1!=null}">
> TEST ACTION1 IS NOT NULL
>
> </j:if>
> <j:if test="${testAction1==null}">
> TEST ACTION1 IS NULL
> </j:if>
>
> </j:if>
>
> <j:if test="${allActions==null}">
> ACTIONS IS NULL
> </j:if>
> </j:if>
> <j:if test="${previousBuild1==null}">
> PREVIOUS BUILD1 IS NULL
> </j:if>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to