requireResources and RequiredResourcesProperty are not available in pipeline multibranch properties

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

XMLWordPrintable

      According to https://www.jenkins.io/doc/pipeline/steps/workflow-multibranch/ there should be possibility to use requireResources or class RequiredResourcesProperty within the property() function in Jenkinsfile.

      When I try to use it with requireResources() like:

      properties([
          parameters(parametersList),
          pipelineTriggers([eventTrigger(jmespathQuery(<myJmesPathQuery>))]),
          requireResources('resourceName')
      ]) 

      I get error that no such DSL methods were find among steps

      When I try to use it with class RequiredResourcesProperty like

      properties([
          parameters(parametersList),
          pipelineTriggers([eventTrigger(jmespathQuery(<myJmesPathQuery>))]),
          [
              $class: 'RequiredResourcesProperty',
              resourceNames: 'resuorceName'
          ]
      ]) 

      I am getting following error:
      ERROR: cannot apply org.jenkins.plugins.lockableresources.RequiredResourcesProperty to a WorkflowJob
      Is there possibility to update the properties of the job (add resource plugin in this section) that way from jenkinsfile?
      Or the documentation is not up-to-date?

            Assignee:
            Unassigned
            Reporter:
            Piotr
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: