Skip to content

triggerBuild: List Git Branches Parameter (TAG) not applied — only core parameters appear in ParametersAction #165

Description

@dierbei

What feature do you want to see added?

Image
### Jenkins / plugins

- **Jenkins**: 2.541.2
- **MCP Server plugin**: MCP Server Plugin 0.158.v8e18e64dd93c
- **List Git Branches Parameter plugin** : List Git Branches Parameter PlugIn 0.0.13

### Summary

When calling the MCP tool `triggerBuild` with a `parameters` map that includes the **List Git Branches** parameter (e.g. `TAG`), the build is queued successfully, but the resulting run’s `ParametersAction` **does not contain** that parameter. Only parameters that map to “core” types (e.g. `StringParameterValue` for choice, `BooleanParameterValue`) appear.

This contradicts the [plugin documentation](https://plugins.jenkins.io/mcp-server/) stating that *Plugin Parameters* are *automatically detected and handled* and that unsupported parameters *fall back to defaults with logging* — in our case `TAG` seems to be dropped silently (no `ListGitBranchesParameterValue` in the build).

### Job configuration (high level)

- Job type: **Pipeline** (`WorkflowJob`), parameterized.
- Parameters include:
  - `APP_ENV`**Choice**
  - `TAG`**List Git Branches (and more)** (`PT_BRANCH_TAG` / `ListGitBranchesParameterDefinition`)
  - `BUILD_ONLY`, `ROLLBACK`**Boolean**

### Steps to reproduce

1. Create or use a parameterized pipeline job with a **List Git Branches Parameter** named e.g. `TAG`.
2. Call MCP `triggerBuild` with JSON similar to:

```json
{
  "jobFullName": "<folder>/<job>",
  "parameters": {
    "APP_ENV": "qa1",
    "TAG": "refs/heads/FEATURE-EFF-xxxxxxx",
    "BUILD_ONLY": false,
    "ROLLBACK": false
  }
}
  1. Open the queued run (or query REST/API .../api/json?tree=actions[parameters[name,value,_class]]).
  2. Inspect actionsParametersActionparameters.

Expected behavior

  • The build should record a parameter value for TAG (e.g. ListGitBranchesParameterValue or equivalent), matching the string passed in parameters.TAG, consistent with Build with Parameters in the UI and with POST .../buildWithParameters (form field TAG=...).

Actual behavior

  • triggerBuild returns success and the build runs, but TAG is missing from ParametersAction.
  • Observed parameters on the run: only APP_ENV, BUILD_ONLY, ROLLBACK.
  • Queue item params string also omits TAG (only the three above).

Additional context

  • Direct REST POST .../buildWithParameters with application/x-www-form-urlencoded including TAG=... works and the run shows the branch/tag parameter correctly.
  • This suggests the MCP server path is not forwarding or not constructing the plugin-specific parameter value for List Git Branches Parameter, while core types work.

Suggested direction

  • Ensure triggerBuild builds the same parameter set as buildWithParameters for all ParameterDefinition types registered on the job, including third-party List Git Branches / PT_BRANCH_TAG.
  • If a parameter cannot be mapped, log explicitly (per docs: Comprehensive logging for debugging parameter issues) instead of silently omitting.

Thank you for looking into this.

Upstream changes

No response

Are you interested in contributing this feature?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions