This seem like a declarative way bug too me. I do this into full scripts 
(changing the current build result) and it work fine.
I haven't tested the declarative (post {}, always {}, ...), but you could 
try a Jenkinsfile without the declarative syntax:

node()
{
try
{
  // make you junit test that make unstable here
}catch()
{
    if (currentBuild.result == 'UNSTABLE')
    currentBuild.result = 'SUCCESS'
}
}

This should work, if so, it mean that the declarative syntax have a bug in 
it and the currentBuild.result is somehow a copy used into the post scope 
and restore after the processing of the declarative post {}. You should 
open a bug report if so.

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c18bc05d-ba2e-44e5-8a0f-ffd2dd42e306%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to