You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
This should require an enhancement to jenkins.go.
When I request a pipeline jenkins job (with parameters), there's no any "actions" has ParameterDefinitions returned.
So when the process goes to below function, it always returns false. // hasParams returns a boolean value indicating if the job is parameterized func hasParams(job Job) bool { for _, action := range job.Actions { if len(action.ParameterDefinitions) > 0 { return true } } return false }
I just found the difference of the way Jenkins API indicates parameter property of a job between freestyle project and pipeline:
with freestyle project,the parameter property is wrapped in "actions": "actions": [ { "_class": "hudson.model.ParametersDefinitionProperty", "parameterDefinitions": [ { "_class": "hudson.model.ChoiceParameterDefinition", "defaultParameterValue": { "_class": "hudson.model.StringParameterValue", "value": "app" }, "description": "", "name": "app", "type": "ChoiceParameterDefinition", "choices": [ "print-app", "idm-app", "file-app" ] } ] }, {}, {}, {}, {}, {}, { "_class": "com.cloudbees.plugins.credentials.ViewCredentialsAction" } ],
with pipeline , the parameter property is wrapped in "property": "property": [ { "_class": "hudson.model.ParametersDefinitionProperty", "parameterDefinitions": [ { "_class": "com.cwctravel.hudson.plugins.extended_choice_parameter.ExtendedChoiceParameterDefinition", "defaultParameterValue": null, "description": "", "name": "Jar_to_Publish", "type": "PT_CHECKBOX" } ] } ],
The text was updated successfully, but these errors were encountered:
Hi there,
This should require an enhancement to jenkins.go.
When I request a pipeline jenkins job (with parameters), there's no any "actions" has ParameterDefinitions returned.
So when the process goes to below function, it always returns false.
// hasParams returns a boolean value indicating if the job is parameterized func hasParams(job Job) bool { for _, action := range job.Actions { if len(action.ParameterDefinitions) > 0 { return true } } return false }
I just found the difference of the way Jenkins API indicates parameter property of a job between freestyle project and pipeline:
with freestyle project,the parameter property is wrapped in "actions":
"actions": [ { "_class": "hudson.model.ParametersDefinitionProperty", "parameterDefinitions": [ { "_class": "hudson.model.ChoiceParameterDefinition", "defaultParameterValue": { "_class": "hudson.model.StringParameterValue", "value": "app" }, "description": "", "name": "app", "type": "ChoiceParameterDefinition", "choices": [ "print-app", "idm-app", "file-app" ] } ] }, {}, {}, {}, {}, {}, { "_class": "com.cloudbees.plugins.credentials.ViewCredentialsAction" } ],
with pipeline , the parameter property is wrapped in "property":
"property": [ { "_class": "hudson.model.ParametersDefinitionProperty", "parameterDefinitions": [ { "_class": "com.cwctravel.hudson.plugins.extended_choice_parameter.ExtendedChoiceParameterDefinition", "defaultParameterValue": null, "description": "", "name": "Jar_to_Publish", "type": "PT_CHECKBOX" } ] } ],
The text was updated successfully, but these errors were encountered: