|
(→Add Random Test Results to a BuildLife)
|
(→Add Random Test Results to a BuildLife)
|
| Line 541: | |||
| testCase.store(); | testCase.store(); | ||
| }</pre> | }</pre> | ||
| + | = Set Property Based on Results of RESOLVE DEPENDENCY ARTIFACTS Step = | ||
| + | Use this script if you need a property to define whether the resolve step was successful or had conflicts. | ||
| + | ==== AHPSCRIPTS-38 ==== | ||
| + | <pre>import com.urbancode.anthill3.services.jobs.*; | ||
| + | status = null; | ||
| + | workflow = WorkflowLookup.getCurrentCase(); | ||
| + | jobs = workflow.getJobTraceArray(); | ||
| + | for (int j=0; j<jobs.length; j++) { | ||
| + | steps = jobs[j].getStepTraceArray(); | ||
| + | for (int s=0; s<steps.length; s++) { | ||
| + | if ("Get Dependency Artifacts".equals(steps[s].getName())) { | ||
| + | if (JobStatusEnum.SUCCESS_WARN.equals(steps[s].getStatus())) { | ||
| + | status = steps[s].getStatus().getName(); | ||
| + | } | ||
| + | else if (JobStatusEnum.SUCCESS.equals(steps[s].getStatus()) && status == null) { | ||
| + | status = steps[s].getStatus().getName(); | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | // set the property | ||
| + | workflow.getRequest().setProperty("resolve.status", status); </pre> | ||