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:
![Product Support Knowledge Base > [Xray] How to create a use a parameterized project in Jenkins > image2020-3-13_10-23-50.png](/download/attachments/57477821/image2020-3-13_10-23-50.png?version=1&modificationDate=1584095319865&api=v2)
- 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})
![Product Support Knowledge Base > [Xray] How to create a use a parameterized project in Jenkins > image2020-3-13_10-25-7.png](/download/attachments/57477821/image2020-3-13_10-25-7.png?version=1&modificationDate=1584095319855&api=v2)
- 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:
![Product Support Knowledge Base > [Xray] How to create a use a parameterized project in Jenkins > image2020-3-13_10-26-16.png](/download/attachments/57477821/image2020-3-13_10-26-16.png?version=1&modificationDate=1584095319835&api=v2)
- Console Output in Jenkins
![Product Support Knowledge Base > [Xray] How to create a use a parameterized project in Jenkins > image2020-3-13_10-27-9.png](/download/attachments/57477821/image2020-3-13_10-27-9.png?version=1&modificationDate=1584095319821&api=v2)
- New Test Execution created in Jira (CALC-2253)
![Product Support Knowledge Base > [Xray] How to create a use a parameterized project in Jenkins > image2020-3-13_10-28-3.png](/download/attachments/57477821/image2020-3-13_10-28-3.png?version=1&modificationDate=1584095319805&api=v2)