Unable to call step currentUserGlobalRoles

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      According to documentation https://github.com/jenkinsci/role-strategy-plugin#getting-roles-in-pipelines one can get the user global and item roles by the step currentUserGlobalRoles.

      When attempting to do so, jenkins pipeline fails indicating such DSL step does not exists:
      ```Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 52f9cb3f-470f-45cf-9375-c61c6a1e88cc
      java.lang.NoSuchMethodError: No such DSL method 'currentUserGlobalRoles' found among steps [addBadge, addEmbeddableBadgeConfiguration, addErrorBadge, addHtmlBadge, addInfoBadge, addShortText, addWarningBadge, ansiColor, archive, bat, build, catchError, checkout, compareVersions, container, containerLog, createSummary, datadog, deleteDir```

      Current pipeline definition is:
      #!groovy
      pipeline {
          agent any
          options

      {         timeout(time: 10, unit: 'MINUTES')     }

          stages {
              stage('Checkout') {
                  steps {
                      script

      {                     currentUserGlobalRoles()                 }

                  }
              }
          }
      }

            Assignee:
            Markus Winter
            Reporter:
            E
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: