{"id":10265,"date":"2026-06-02T16:56:45","date_gmt":"2026-06-02T11:26:45","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=10265"},"modified":"2026-08-28T16:08:28","modified_gmt":"2026-08-28T10:38:28","slug":"how-to-add-choice-parameter-in-jenkins-job-for-branch-selection","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-add-choice-parameter-in-jenkins-job-for-branch-selection\/","title":{"rendered":"How to Add Choice Parameter in Jenkins Job for Branch Selection"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In Jenkins, parameterized builds allow users to provide input values before triggering a job. One of the most useful parameters in CI\/CD environments is the <strong>Choice Parameter<\/strong>, which enables users to select a specific Git branch during the build process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of creating separate Jenkins jobs for different branches such as <code>develop<\/code>, <code>test<\/code>, and <code>main<\/code>, administrators can configure a single Jenkins job with branch options. When users click the <strong>Build With Parameters<\/strong> option, Jenkins displays a dropdown menu containing the available branches. Users can then select the required branch and trigger the build.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before configuring the branch choice parameter in Jenkins, ensure the following requirements are completed:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Jenkins server is installed and running<\/li>\n\n\n\n<li>A Jenkins job is already created or ready to be created.<\/li>\n\n\n\n<li>Git repository is connected to the Jenkins job<\/li>\n\n\n\n<li>The Git repository contains the branches that will be available for selection (for example: <code>develop<\/code>, <code>test<\/code>, and <code>main<\/code>).<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">IMPLEMENTATION<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Open Jenkins Job Configuration<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Login to Jenkins<\/li>\n\n\n\n<li>Open the required Jenkins job<\/li>\n\n\n\n<li>Click on: Configure option<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-6.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"735\" height=\"313\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-6.png\" alt=\"\" class=\"wp-image-10266\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-6.png 735w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-6-300x128.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-6-704x300.png 704w\" sizes=\"(max-width: 735px) 100vw, 735px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Enable Parameterized Build<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Under the <strong>General<\/strong> section:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enable the option: <strong>This project is parameterized<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This allows Jenkins to display parameters before starting the build.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-10.png\"><img decoding=\"async\" width=\"995\" height=\"311\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-10.png\" alt=\"\" class=\"wp-image-10269\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-10.png 995w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-10-300x94.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-10-768x240.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-10-850x266.png 850w\" sizes=\"(max-width: 995px) 100vw, 995px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Add Choice Parameter<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Click on: Add Parameter<\/li>\n\n\n\n<li>Select: Choice Parameter<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-9.png\"><img decoding=\"async\" width=\"907\" height=\"387\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-9.png\" alt=\"\" class=\"wp-image-10270\" style=\"aspect-ratio:2.3438113092383484;width:623px;height:auto\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-9.png 907w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-9-300x128.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-9-768x328.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-9-703x300.png 703w\" sizes=\"(max-width: 907px) 100vw, 907px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Configure Branch Choices<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"723\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-8-1024x723.png\" alt=\"\" class=\"wp-image-10268\" style=\"aspect-ratio:1.417011518490208;width:550px;height:auto\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-8-1024x723.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-8-300x212.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-8-768x542.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-8-425x300.png 425w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-8.png 1101w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Configure the parameter using the following values.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Name<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>BRANCH<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Choices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>develop <\/li>\n\n\n\n<li>test <\/li>\n\n\n\n<li>main<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Description<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Select the branch to build<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Save the Configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Click: Save<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Jenkins job is now configured successfully.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 7: Build the Job Using Parameters<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the Jenkins job<\/li>\n\n\n\n<li>Click: Build With Parameters<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Now Jenkins will display a branch selection dropdown like below:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>BRANCH \u251c\u2500\u2500 develop \u251c\u2500\u2500 test \u2514\u2500\u2500 main<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-11.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1018\" height=\"607\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-11.png\" alt=\"\" class=\"wp-image-10272\" style=\"aspect-ratio:1.6771174543752925;width:584px;height:auto\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-11.png 1018w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-11-300x179.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-11-768x458.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/05\/image-11-503x300.png 503w\" sizes=\"(max-width: 1018px) 100vw, 1018px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Adding a choice parameter in a Jenkins job is an efficient method for handling multiple Git branches within a single CI\/CD pipeline. By configuring branch options such as <code>develop<\/code>, <code>test<\/code>, and <code>main<\/code>, users can easily select the required branch while triggering the build using the <strong>Build With Parameters<\/strong> option.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This approach simplifies Jenkins management, reduces duplicate jobs, and improves deployment flexibility across different environments.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In Jenkins, parameterized builds allow users to provide input values before triggering a job. One of the most useful [&hellip;]<\/p>\n","protected":false},"author":510,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1020],"tags":[1015,354],"class_list":["post-10265","post","type-post","status-publish","format-standard","hentry","category-containers-kubernetes","tag-choice-parameter","tag-jenkins","psol-cat-containers-kubernetes"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-2Fz","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/10265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/510"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=10265"}],"version-history":[{"count":3,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/10265\/revisions"}],"predecessor-version":[{"id":10279,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/10265\/revisions\/10279"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=10265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=10265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=10265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}