-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: _unsorted
Problem
== Inline Script Block
Line: 31
----
<script type="text/javascript">
(function(Q) {
function toggleCredentials(ele) {
var isUserAuthJiraInstance = ele
.find("#exportCucumber_selectInstance_${descriptor.defaultBuildID()}")
.find('option:selected')
.text()
.indexOf("[User Auth required] ") === 0;
const $selectParent = ele
.find('#exportCucumber_credentialId_${descriptor.defaultBuildID()}')
.parent()
.parent();
if (isUserAuthJiraInstance) {
$selectParent.show();
} else {
$selectParent.hide();
}
};
setTimeout(function () {
Q(".export-features-wrapper").each(function () {
const wrapperID = Q(this).attr("id");
Q(this).removeClass("export-features-wrapper");
var ele = Q(Q("#" + wrapperID)
.parents('.xray-export-feature')
.get(0));
toggleCredentials(ele);
ele.find("#exportCucumber_selectInstance_${descriptor.defaultBuildID()}")
.change(function () {
toggleCredentials(ele);
});
setTimeout(function() {
toggleCredentials(ele);
}, 1000);
});
}, 500);
})(jQuery);
</script>
----
Solution
https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks