Sometimes, it is useful/necessary to turn the builds in Jenkins more flexible/dynamic. For that, in the Jenkins job, you can configure it as a parameterized project.

Example using a Freestyle project and a multipart endpoint

  • Create a freestyle project
  • In the job configuration page check the option "This project is parameterized" and click in the option “Add Parameters”. There is a drop-down option to configure parameterized build options (like a boolean attribute, or a string attribute).
  • Example:
  • In the previous example, I just have created two parameters that will be used to define the description of the Test Execution and in which project the new Test Execution will be created based in the parameters that will be passed when running the job.
  • In the Post-Build: Xray: Results Import task, you configure where the parameters will be read and used, using the syntax ${parametername} (${Description} and ${ProjectKey})
  • Save it
  • Now you will notice that the “Build Now” text has changed to “Build Now with Parameters”, and clicking on the link provides you the option to set those parameters for the build.Example:
  • Console Output in Jenkins
  • New Test Execution created in Jira (CALC-2253)


Related Documentation