-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Currently, the Jenkins API for jobs returns run parameter definitions in the following way (JSON here but the result for XML is equivalent):
{
"_class":"hudson.model.RunParameterDefinition",
"defaultParameterValue":{
"_class":"hudson.model.RunParameterValue"
},
"description":"",
"name":"Run_Parameter",
"type":"RunParameterDefinition",
"projectName":"Project"
}
Unfortunately this parameter definition does not include the build filter that can be set up alongside the projectName and description when configuring the run parameter.
I believe that including this filter in the JSON would be beneficial for some use cases while not affecting others. The proposed return value would look like this:
{
"_class":"hudson.model.RunParameterDefinition",
"defaultParameterValue":{
"_class":"hudson.model.RunParameterValue"
},
"description":"",
"name":"Run_Parameter",
"type":"RunParameterDefinition",
"filter":"COMPLETED",
"projectName":"Project"
}
I would be very glad to implement this change myself if the change is agreed upon.
Furthermore, I would be interested in knowing whether there are any ways to circumvent the current behaviour and retrieve the filter nonetheless.
Originally reported by
mobi_robert, imported from: Include run parameter filter value in API
- status: Open
- priority: Minor
- component(s): core
- label(s): api, parameter, runparameter
- resolution: Unresolved
- votes: 0
- watchers: 1
- imported: 2025-11-24
Raw content of original issue
Currently, the Jenkins API for jobs returns run parameter definitions in the following way (JSON here but the result for XML is equivalent):
{ "_class":"hudson.model.RunParameterDefinition", "defaultParameterValue":{ "_class":"hudson.model.RunParameterValue" }, "description":"", "name":"Run_Parameter", "type":"RunParameterDefinition", "projectName":"Project" }Unfortunately this parameter definition does not include the build filter that can be set up alongside the projectName and description when configuring the run parameter.
I believe that including this filter in the JSON would be beneficial for some use cases while not affecting others. The proposed return value would look like this:
{ "_class":"hudson.model.RunParameterDefinition", "defaultParameterValue":{ "_class":"hudson.model.RunParameterValue" }, "description":"", "name":"Run_Parameter", "type":"RunParameterDefinition", "filter":"COMPLETED", "projectName":"Project" }I would be very glad to implement this change myself if the change is agreed upon.
Furthermore, I would be interested in knowing whether there are any ways to circumvent the current behaviour and retrieve the filter nonetheless.