diff --git a/jenkins_jobs/modules/triggers.py b/jenkins_jobs/modules/triggers.py index 0ddef3ff8..eca862346 100644 --- a/jenkins_jobs/modules/triggers.py +++ b/jenkins_jobs/modules/triggers.py @@ -1204,7 +1204,7 @@ def reverse(parser, xml_parent, data): jobs threshold = XML.SubElement(reserveBuildTrigger, 'threshold') - result = data.get('result').upper() + result = str(data.get('result', 'success')).upper() if result not in supported_thresholds: raise jenkins_jobs.errors.JenkinsJobsException( "Choice should be one of the following options: %s." % diff --git a/tests/triggers/fixtures/reverse-default.xml b/tests/triggers/fixtures/reverse-default.xml new file mode 100644 index 000000000..f6a1902cb --- /dev/null +++ b/tests/triggers/fixtures/reverse-default.xml @@ -0,0 +1,15 @@ + + + + + + Fantastic-job + + SUCCESS + 0 + BLUE + true + + + + diff --git a/tests/triggers/fixtures/reverse-default.yaml b/tests/triggers/fixtures/reverse-default.yaml new file mode 100644 index 000000000..a613c917d --- /dev/null +++ b/tests/triggers/fixtures/reverse-default.yaml @@ -0,0 +1,3 @@ +triggers: + - reverse: + jobs: 'Fantastic-job'