jenkinsci / jenkinsci/git-parameter-plugin

[JENKINS-57652] Git Parameters returning default and no error logged

Open
#279 0 comments 0 reactions 0 assignees View on GitHub
component:git-parameter-plugin imported-jira-issue priority:blocker resolution:unresolved
Dominant language
Java
Stars
131
Forks
134
Avg merge
21h 5m
Merged PRs (30d)
1

Description

I get intermitten results from the gitParameter option.

Sometime I get

no list, and the default is chosen

a partial list of  branches

a full list of branches (rarely)

This is what is in my pipeline script 

gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH_NAME', type: 'PT_BRANCH'

stage('Checkout') {

    steps {

        dir ('code') {

            git(branch: "${params.BRANCH_NAME}", url: 'XXXXXX')

        }

    }

}

 

Is there a way to fix this or can we allow users to enter a branch name manually?

My scenario is I need the jobs definition to be stored in  git, hence I am using pipeline jobs stored as JenkinsFiles.

multibranch pipeline job does not suit as these jobs are to be triggered by users, and/or cron.

 

---
Originally reported by philrumble, imported from: Git Parameters returning default and no error logged


  • status: Open
  • priority: Blocker
  • component(s): git-parameter-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251216-182730

Raw content of original issue

I get intermitten results from the gitParameter option.

Sometime I get

no list, and the default is chosen

a partial list of  branches

a full list of branches (rarely)

This is what is in my pipeline script 

gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH_NAME', type: 'PT_BRANCH'

stage('Checkout') {
    steps {
        dir ('code') {
            git(branch: "${params.BRANCH_NAME}", url: 'XXXXXX')
        }
    }
}

 

Is there a way to fix this or can we allow users to enter a branch name manually?

My scenario is I need the jobs definition to be stored in  git, hence I am using pipeline jobs stored as JenkinsFiles.

multibranch pipeline job does not suit as these jobs are to be triggered by users, and/or cron.

 

  • environment: Jenkins ver. 2.164.3 all plugins up to date centos7

1 attachment

- [image-2019-05-24-11-44-43-250.png](https://issues.jenkins.io/secure/attachment/47497/image-2019-05-24-11-44-43-250.png)
> ![image-2019-05-24-11-44-43-250.png](https://issues.jenkins.io/secure/attachment/47497/image-2019-05-24-11-44-43-250.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.