I am searching a way to define pipeline options
based on JOB_NAME in declarative pipeline
pipeline {
agent any
options {
when { expression { return env.JOB_NAME.equals('test_job') } } <----------
disableConcurrentBuilds()
}
and I am getting the error
11:23:15 WorkflowScript: 39: Options definitions cannot have blocks @ line 39, column 9.
11:23:15 when { expression { return env.JOB_NAME.equals('test_job') } }
Any workaround to achieve this? Thank you