How can I use the super type option in the Job Templates?
- CloudBees Jenkins Enterprise - Managed controller (CJE-MM)
- CloudBees Jenkins Team (CJT)
- CloudBees Jenkins Platform - Client controller (CJP-CM)
When you create a new Job Template you can see a select field named “Super type”, but how can you use that field?
The use of supertypes in Job Templates is for hierarchy purpose only (like the general use in Java).
For Jenkins Job Templates you can use supertypes to have the same attributes in different jobs with the advantage that if you change the supertype job template all the templates that use it also changes.
For use it, you only have to define de supertype job template and in your script use the attributes of the supertype (Be careful of having some attributes with the same name).
For example, if you define a Job Template “TestJobTemplate” with an attribute “testAtribute”, and you create a new Job Template named:“TestTemplateJob2” where you select as Super type "TestJobTemplate. The jobs that you create from the template “TestTamplateJob2” will have all the attributes of the TestTemplateJob2 and TestJobTemplate
The supertypes don’t allow you to reuse the transformation because if they allow you the final job would be the same of the supertype.
The latest update of this article was tested with:
- Jenkins LTS 126.96.36.199