Version Differences for Status Scripts

(Set a Build Life Status on Any Failed Test (Assign Status Step))
(Script to Set a Build Life Status if Any Tests Fail)
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.    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. 
       
    + = Assign Status or Failure in One Step =  
       
    + ==== AHPSCRIPTS-45 ====  
    + <pre>import com.urbancode.anthill3.services.jobs.JobStatusEnum;  
    + project = ProjectLookup.getCurrent();  
    + success = project.getStatusGroup().SUCCESS();  
    + failure = project.getStatusGroup().FAILURE();  
    + result = success;  
    + workflow = WorkflowLookup.getCurrentCase();  
    + jobArray = workflow.getJobTraceArray();  
    + for (int j=0; j<jobArray.length; j++) {  
    + stepArray = jobArray[j].getStepTraceArray();  
    + for (int s = 0; s < stepArray.length; s++) {  
    + if (!stepArray[s].isIgnoreMyFailures() &&  
    + JobStatusEnum.FAILED.equals(stepArray[s].getStatus())) {  
    + result = failure;  
    + break;  
    + }  
    + }  
    + if (failure.equals(result)) {  
    + break;  
    + }  
    + }  
    + return result;</pre>  
       
  = Script to Set a Build Life Status if Any Tests Fail =    = Script to Set a Build Life Status if Any Tests Fail =