Mark a job unstable in Jenkins from a shell script
By Jesse Morgan
Here’s the workaround I cam up with
Configure JUnit reports to read status.xml and output something like this:
echo '<testsuite><testcase classname="yourJob" name="yourError"><failure>
a description of the error
</failure></testcase></testsuite>'>status.xml
Simple as that!