<p>This looks to me the same as the issue here : <a href="https://devops.stackexchange.com/questions/18687/how-to-modify-a-jenkins-pipeline-jobs-property-programmatically/19569#19569">How to modify a Jenkins pipeline job's property programmatically</a>.</p>
<h4>Summary</h4>
<ul>
<li>You can either use <strong>Jenkinsfile</strong> ; this would require efforts but it's better in the long run, or you can use <strong>Jenkins API/CLI</strong> to <strong>get/update job configuration</strong>, with some kind of <strong>wrapper</strong> either <strong>Bash or Python</strong> to <strong>update your config.xml</strong> with your changes.</li>
</ul>

CC BY-SA 4.0
2024-08-16T20:23:15.343Z
2024-08-18T20:07:00.123Z
2024-08-18T20:07:00.123Z
YassineLbk
<p>You can invoke a pipeline with parameters in a step, in a stage, of your main pipeline. Here is an example from <a href="https://stackoverflow.com/questions/43337070/how-to-invoke-a-jenkins-pipeline-a-in-another-jenkins-pipeline-b">another answer</a>:</p>
<pre><code>pipeline {
    agent
    {
        node {
                label 'master'
                customWorkspace &quot;${env.JobPath}&quot;
              }
    }

    stages 
    {
        stage('Start') {
            steps {
                sh 'ls'
            }
        }

        stage ('Invoke_pipeline') {
            steps {
                build job: 'pipeline1', parameters: [
                string(name: 'param1', value: &quot;value1&quot;)
                ]
            }
        }

        stage('End') {
            steps {
                sh 'ls'
            }
        }
    }
}
</code></pre>
<p>You can then use build parameters to pass data to a Jenkins job, and if needed parametrize it manually from a web interface. See these screenshots from this <a href="https://www.baeldung.com/ops/jenkins-parameterized-builds" rel="nofollow noreferrer">Baeldung guide</a>.</p>
<p><a href="https://i.sstatic.net/Gsnd3h8Q.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Gsnd3h8Q.png" alt="Build with Parameters" /></a></p>
<p><a href="https://i.sstatic.net/KnLEUfyG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KnLEUfyG.png" alt="Project parametrized-example" /></a></p>

CC BY-SA 4.0
2024-08-18T20:56:36.223Z
2024-08-18T20:56:36.223Z
Ortomala Lokni
<p>I have multiple pipelines that I need to update each time the version of my program changes. Is it possible to create Jenkins pipelines (instead of clicking <code>+ New Item</code> in UI) or update them (for example which branch or tag to use, or time of execution) using another main pipeline. Otherwise every time something changes I have to go through each pipeline and click on <code>Configure</code> and update it manually.</p>

CC BY-SA 4.0
2024-06-16T12:51:12.533Z
Givin' a very brief picture is using [Jenkins job builder](https://jenkins-job-builder.readthedocs.io/en/latest/) (a.k.a, JJB), and in your yaml file you can switch `repo_branch: master` to `repo_branch: <feature-branch>`. Afterwards you can apply the branch changes using `jenkins-jobs --conf <your conf.ini> update configs/your_job_.yaml:configs/defaults.yaml`, This could be useful in your case. However, adopting JJB into your pipeline requires more investigation.
Chachatonel Hashimotto
CC BY-SA 4.0
2024-08-08T11:52:42.117Z
Can that change be parameterized?
Iterokun 
<jenkins><jenkins-pipeline><automation>
Automating Jenkins Pipeline Creation and Configuration Updates
Mykola Zotko
# Automating Jenkins Pipeline Creation and Configuration Updates

(Asked by: username_0 on 2024-05-24)

I have multiple pipelines that I need to update each time the version of my program changes. Is it possible to create Jenkins pipelines (instead of clicking `+ New Item` in UI) or update them (for example which branch or tag to use, or time of execution) using another main pipeline. Otherwise every time something changes I have to go through each pipeline and click on `Configure` and update it manually.

**Tags:** jenkins, jenkins-pipeline, automation

> **Comments:**
> **username_1**: Givin' a very brief picture is using [Jenkins job builder](https://jenkins-job-builder.readthedocs.io/en/latest/) (a.k.a, JJB), and in your yaml file you can switch `repo_branch: master` to `repo_branch: <feature-branch>`. Afterwards you can apply the branch changes using `jenkins-jobs --conf <your conf.ini> update configs/your_job_.yaml:configs/defaults.yaml`, This could be useful in your case. However, adopting JJB into your pipeline requires more investigation.  
> **username_2**: Can that change be parameterized?  

---

## 2 answers

### Answer by username_3 on 2024-08-16. Score: 1

This looks to me the same as the issue here : [How to modify a Jenkins pipeline job's property programmatically](https://devops.stackexchange.com/questions/18687/how-to-modify-a-jenkins-pipeline-jobs-property-programmatically/19569#19569).

#### Summary

* You can either use **Jenkinsfile** ; this would require efforts but it's better in the long run, or you can use **Jenkins API/CLI** to **get/update job configuration**, with some kind of **wrapper** either **Bash or Python** to **update your config.xml** with your changes.


---

### Answer by username_4 on 2024-08-18. Score: 0

You can invoke a pipeline with parameters in a step, in a stage, of your main pipeline. Here is an example from another answer:
pipeline {
    agent
    {
        node {
                label 'master'
                customWorkspace "${env.JobPath}"
              }
    }

    stages 
    {
        stage('Start') {
            steps {
                sh 'ls'
            }
        }

        stage ('Invoke_pipeline') {
            steps {
                build job: 'pipeline1', parameters: [
                string(name: 'param1', value: "value1")
                ]
            }
        }

        stage('End') {
            steps {
                sh 'ls'
            }
        }
    }
}

You can then use build parameters to pass data to a Jenkins job, and if needed parametrize it manually from a web interface. See these screenshots from this Baeldung guide.


---

