How to create jenkinsfile properties to run groovy code on

I’m trying to create properties that can be set in the jenkins file but I can’t find any details on how to do it. I’m looking to set a property in the jenkinsfile so that users can set a value I can create pipeline groovy for. I haven’t been able to find anything on creating and how to use that property value.

@jpat There are many ways to define properties inside a Jenkins file

  1. Using def

    def property = "propety-value"
  2. If you want it as build parameters, you need to look at options like build with parameters, or active choice parameter for dynamic decision parameters.