jenkinsci / jenkinsci/git-parameter-plugin

[JENKINS-49457] Git Parameter does not work as input in a scripted pipeline

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

Description

I tried to use the git parameter plugin in a pipeline script to fill an input (Target Branch to merge to in another repository).

According to https://jenkins.io/doc/pipeline/steps/pipeline-input-step/ GitParameters should work for inputs, 

input(

id: 'Proceed1', message: 'Specifiy QA Candiate Branch',
parameters: [
[$class: 'GitParameterDefinition',
name: 'candidateBranch',
type: 'PT_BRANCH',
]
]
)

This gets rendered but whatever I do the branch select stays empty (When refreshing I can see a brief spinner with "Retrieving..."). I also tried to capture related logs but couldn't get anything (From looking at the code only exceptional cases are logged).

I also tried as documented in https://jenkins.io/doc/pipeline/steps/pipeline-input-step/

type: 'Branch' 

Just to validate that it works in general I added the parameter to the job itself and if I trigger a parameterized build the select is properly filled.

---
Originally reported by mjungsbluth, imported from: Git Parameter does not work as input in a scripted pipeline


  • assignee: klimas7
  • status: In Progress
  • priority: Minor
  • component(s): git-parameter-plugin
  • resolution: Unresolved
  • votes: 3
  • watchers: 5
  • imported: 20251216-182730

Raw content of original issue

I tried to use the git parameter plugin in a pipeline script to fill an input (Target Branch to merge to in another repository).

According to https://jenkins.io/doc/pipeline/steps/pipeline-input-step/ GitParameters should work for inputs, 



input(

id: 'Proceed1', message: 'Specifiy QA Candiate Branch',
parameters: [
[$class: 'GitParameterDefinition',
name: 'candidateBranch',
type: 'PT_BRANCH',
]
]
)


This gets rendered but whatever I do the branch select stays empty (When refreshing I can see a brief spinner with "Retrieving..."). I also tried to capture related logs but couldn't get anything (From looking at the code only exceptional cases are logged).

I also tried as documented in https://jenkins.io/doc/pipeline/steps/pipeline-input-step/



type: 'Branch' 


Just to validate that it works in general I added the parameter to the job itself and if I trigger a parameterized build the select is properly filled.

environment

```
Jenkins ver. 2.89.1

Git Parameter Plugin 0.90
```

Contributor guide

Open the contributing guide

Research direction

The entry point is the documented Pipeline input step using GitParameterDefinition; first compare it with the job-level parameter path described in the report. Evaluate both the PT_BRANCH and Branch forms. Done means the scripted-pipeline input populates its branch selector instead of remaining empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, java
Domain
devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.