Jenkins Jelly select不保存所选选项

Jenkins Jelly select不保存所选选项,jenkins,jenkins-plugins,dropdown,jelly,Jenkins,Jenkins Plugins,Dropdown,Jelly,我在config.jelly中使用了以下几行代码 <f:entry title="${%Report file extension}" field="ReportExtension"> <select name="ReportBuilder.ReportExtension" selected = "${instance.ReportExtension}"> <option value="log" selected="${instance.Re

我在config.jelly中使用了以下几行代码

<f:entry title="${%Report file extension}" field="ReportExtension">
    <select name="ReportBuilder.ReportExtension" selected = "${instance.ReportExtension}">
        <option value="log" selected="${instance.ReportExtension=='log'}">log</option>
        <option value="html" selected="${instance.ReportExtension=='html'}">html</option>               
    </select>
</f:entry>

日志
html
如果我更改Jenkis作业中的值,然后运行作业,则会使用正确的值,但如果我再次编辑作业,则不会保存选择,并会再次存储默认值


以前有人见过这个吗?我尝试了我发现的几种不同的方法,但都没有成功。

尝试下面的代码,简单地返回true或false不起作用。您必须返回字符串“true”或“false”

<f:entry title="${%Report file extension}" field="ReportExtension">
<select name="ReportBuilder.ReportExtension" >
    <option value="log" selected="${instance.ReportExtension.equals('log')? 'true':null}">log</option>
    <option value="html" selected="${instance.ReportExtension.equals('html')? 'true':null}">html</option>               
</select>

日志
html

尝试下面的代码,简单地返回true或false不起作用。您必须返回字符串“true”或“false”

<f:entry title="${%Report file extension}" field="ReportExtension">
<select name="ReportBuilder.ReportExtension" >
    <option value="log" selected="${instance.ReportExtension.equals('log')? 'true':null}">log</option>
    <option value="html" selected="${instance.ReportExtension.equals('html')? 'true':null}">html</option>               
</select>

日志
html

你是个天才:)。我还必须从select标记中删除selected属性。但现在它起作用了你是个天才:)。我还必须从select标记中删除selected属性。但现在它起作用了