[servicenow-devops] Extract inline script block in io/jenkins/plugins/pipeline/steps/DevOpsPipelineRegisterSecurityStep/config.jelly

XMLWordPrintable

      Problem

      == Inline Script Block
      Line: 20
      ----
      <script type="text/javascript">
            // Function to update the textarea content based on dropdown selection
            function updateContent(selectedOption) {
              var contentArea = document.getElementById("securityAttributeJson");
              if(!contentArea || !(contentArea instanceof Element))
                  return;
              // Update content based on selected option
              if (selectedOption === "Veracode") {
                contentArea.value = '{"scanner": "Veracode", "applicationName": "", "buildVersion": "", "securityToolId": ""}';
              } else if (selectedOption === "Checkmarx One") {
                contentArea.value = '{"scanner": "Checkmarx One", "projectName": "", "projectId": "", "scanId": "", "securityToolId": ""}';
              } else if (selectedOption === "Checkmarx SAST") {
                contentArea.value = '{"scanner": "Checkmarx SAST", "projectId": "", "securityToolId": ""}';
              } else if (selectedOption === "Others") {
                contentArea.value = '{"scanner": "", "securityToolId": ""}';
              }
            }
            updateContent("Veracode");
          </script>
      ----
      

      Solution

      https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks

            Assignee:
            Unassigned
            Reporter:
            Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: