How to Overcome Template Clobbering Issues? Bee Bot July 13, 2022 11:20 Updated The content of this article has moved to the new documentation site. Related articles Creating credentials using Groovy Pipeline - Create a Parameterized Pipeline using Template Why do I get an Error 500 when creating a new template instance? How can I purge/clean the build queue? Groovy to list all jobs Comments 1 comment Sort by Date Votes Owen Wood February 27, 2018 00:58 Testing on Jenkins 2.89.1.6, the following: <% if (instance != null && instance.item != null && instance.item.getProperties() != null) { %> ${xml(hudson.model.Items.XSTREAM.toXML(instance.item.getProperties()))} <% } doesn't work. instance.item.getProperties actually now returns hudson.util.DescribableList while type <properties> is expected. This can be fixed by changing the previous to: <% if (instance != null && instance.item != null && instance.item.getProperties() != null) { %> <properties> <% instance.item.getProperties().each { %> ${xml(hudson.model.Items.XSTREAM.toXML(it))} <% } %> </properties> <% } Guessing that this has something to do with the changes to Xstream present in more recent versions of Jenkins. 0 Please sign in to leave a comment.
Comments
1 comment
Testing on Jenkins 2.89.1.6, the following:
doesn't work. instance.item.getProperties actually now returns
while type <properties> is expected.
This can be fixed by changing the previous to:
Guessing that this has something to do with the changes to Xstream present in more recent versions of Jenkins.
Please sign in to leave a comment.