Version Differences for Status Scripts

(Initial page creation.)
Line 1:
    + This page lists '''assign status''' scripts (used for status selectors) listed in the scripting site. These scripts were taken straight from the public JIRA site. Please note that some scripts may be snippets and probably WILL need modification to work properly for your situation. Treat these as templates that you can modify from.  
       
    + = Script to Set a Build Life Status if Any Tests Fail =  
       
    + Script Notes:  
    + * This script goes in an '''Assign Status''' step.  
       
    + ==== AHPSCRIPTS-37 ====  
       
    + <pre>import com.urbancode.anthill3.domain.test.*;  
       
    + reports = TestReportFactory.getInstance().restoreAllForJobTrace(JobTraceLookup.getCurrent());  
    + for (int i=0; i<reports.length; i++) {  
    + if (reports[i].getNumberOfFailures() > 0) {  
    + return "Failed Tests";  
    + }  
    + }  
    + return null;</pre>