Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47666

Scripts not permitted to use staticMethod java.lang.Math max int int

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Scripts not permitted to use staticMethod java.lang.Math max int int

        last_run = selectRun filter: parameters("Target_OS=CentOS${os}"), job: env.JOB_NAME, selector: status('STABLE'), verbose: true
        id_to_copy = Math.max(id_to_copy,last_run.getId() as int)
      

      Expected outcome: ability to use, or at least approve under /scriptApproval/, Math.max(). If there's a better way to do it, I am a groovy noob and just copying examples in most places.

        Attachments

          Issue Links

            Activity

            aarondmarasco_vsi Aaron Marasco created issue -
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Component/s script-security-plugin [ 18520 ]
            Component/s pipeline [ 21692 ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #159 (Web Link)" [ 17961 ]
            Hide
            abayer Andrew Bayer added a comment -

            PR up at https://github.com/jenkinsci/script-security-plugin/pull/159 adding Math.max and Math.min - wasn't sure if there were any other Math static methods we would want, but max and min definitely seem reasonable.

            Show
            abayer Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/script-security-plugin/pull/159 adding Math.max and Math.min - wasn't sure if there were any other Math static methods we would want, but max and min definitely seem reasonable.
            Hide
            abayer Andrew Bayer added a comment -

            Fixed in next script-security plugin release (will be 1.35)

            Show
            abayer Andrew Bayer added a comment - Fixed in next script-security plugin release (will be 1.35)
            abayer Andrew Bayer made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                aarondmarasco_vsi Aaron Marasco
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: