Skip to content

fix(Jenkins Node): Properly load job parameters#28631

Merged
RomanDavydchuk merged 5 commits intomasterfrom
node-4823-community-issue-jenkins-trigger-with-parameters-operation
Apr 23, 2026
Merged

fix(Jenkins Node): Properly load job parameters#28631
RomanDavydchuk merged 5 commits intomasterfrom
node-4823-community-issue-jenkins-trigger-with-parameters-operation

Conversation

@RomanDavydchuk
Copy link
Copy Markdown
Contributor

@RomanDavydchuk RomanDavydchuk commented Apr 17, 2026

Summary

Jenkins can expose build parameters in different places depending on job type and Jenkins/plugin version, so reading only one field is incomplete.

  • actions is common for older/freestyle-style jobs
  • property is common for Pipeline and newer configurations
  • Both can represent the same ParametersDefinitionProperty, just in different parts of the job JSON
  • If we read only actions, many valid parameterized jobs return “No data” even though parameters exist
  • Reading both makes the node compatible across real-world Jenkins setups and avoids false negatives in the UI
  • Deduplication is needed because property may include parameters that are also returned in actions

Testing

Manual

To manually test:

  1. Run Jenkins, for example using Docker: docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
  2. Create a pipeline job
  3. Go to "Configure" section of the job and check "This project is parameterized"
  4. Add any parameters you like for testing
  5. Go to n8n, add Jenkins node
  6. Select "Trigger with Parameters" operation, select the pipeline job you created
  7. Try adding the parameter. Check if parameter name is loaded or not (you should see the parameters you created in Jenkins)

Before the fix (no parameters are loaded for the pipeline job):

2026-04-17.20-02-08.mp4

After the fix (parameters are loaded for both pipeline and freestyle jobs):

2026-04-17.20-01-15.mp4

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-4823/community-issue-jenkins-trigger-with-parameters-operation-fails-to-pre
Closes #27991

Review / Merge checklist

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

@RomanDavydchuk RomanDavydchuk marked this pull request as ready for review April 17, 2026 17:08
@Joffcom Joffcom requested a review from yehorkardash April 17, 2026 17:08
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

Performance Comparison

Comparing currentlatest master14-day baseline

docker-stats

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
docker-image-size-n8n 1269.76 MB 1269.76 MB 1273.60 MB (σ 10.49) +0.0% -0.3%
docker-image-size-runners 388.00 MB 386.00 MB 392.13 MB (σ 11.18) +0.5% -1.1%

Idle baseline with Instance AI module loaded

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
instance-ai-heap-used-baseline 186.63 MB 186.50 MB 186.43 MB (σ 0.25) +0.1% +0.1%
instance-ai-rss-baseline 386.45 MB 392.12 MB 368.35 MB (σ 22.82) -1.4% +4.9%

Memory consumption baseline with starter plan resources

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
memory-heap-used-baseline 114.26 MB 114.27 MB 114.47 MB (σ 0.24) -0.0% -0.2%
memory-rss-baseline 337.99 MB 348.40 MB 289.80 MB (σ 40.90) -3.0% +16.6% ⚠️
How to read this table
  • Current: This PR's value (or latest master if PR perf tests haven't run)
  • Latest Master: Most recent nightly master measurement
  • Baseline: Rolling 14-day average from master
  • vs Master: PR impact (current vs latest master)
  • vs Baseline: Drift from baseline (current vs rolling avg)
  • Status: ✅ within 1σ | ⚠️ 1-2σ | 🔴 >2σ regression

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant Bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Apr 22, 2026
Copy link
Copy Markdown
Contributor

@yehorkardash yehorkardash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just one clarification question

continue;
}

for (const { name, type } of parameterDefinitions) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if Jenkins API may allow having null here, but maybe worth adding guard against null/undefined here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added Array.isArray check for parameterDefinitions which covers nullish values as well

for (const { name, type } of parameterDefinitions) {
const endpoint = `/job/${job}/api/json?tree=actions[parameterDefinitions[*]],property[parameterDefinitions[*]]`;
const result = await jenkinsApiRequest.call(this, 'GET', endpoint);
const allParameters = [...(result.actions ?? []), ...(result.property ?? [])];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can Jenkins return both result.actions and result.property leading to duplicate parameters?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, here's one of the API responses from actual Jenkins service, as you can see both property and action have a parameter str_freestyle
image

@RomanDavydchuk RomanDavydchuk added this pull request to the merge queue Apr 23, 2026
Merged via the queue into master with commit f2aa016 Apr 23, 2026
61 checks passed
@RomanDavydchuk RomanDavydchuk deleted the node-4823-community-issue-jenkins-trigger-with-parameters-operation branch April 23, 2026 10:14
@n8n-assistant n8n-assistant Bot mentioned this pull request Apr 28, 2026
@n8n-assistant
Copy link
Copy Markdown
Contributor

n8n-assistant Bot commented Apr 28, 2026

Got released with n8n@2.19.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jenkins "Trigger with Parameters" operation fails to pre-load job parameters

2 participants