How do I get only selected jenkins information from the API response.

I tried with the below url

*https://myorg.com/job/architecture-shared-services/job/myrepo/api/json?tree=builds[number,url,result,actions[parameters[name,value]]]&pretty=true{0,2}
 
<https://myorg.com/job/architecture-shared-services/job/myrepo/api/json?tree=builds%5Bnumber,url,result,actions%5Bparameters%5Bname,value%5D%5D%5D&pretty=true%7B0,2%7D>*

and it returned almost all data present in the build details.

How do I filter rulesetid,branch details only from the parameter object, 
while rest of the parameters are not required in the response.

Below is my API Response


{ "_class": "org.jenkinsci.plugins.workflow.job.WorkflowJob", "builds": [ { 
"_class": "org.jenkinsci.plugins.workflow.job.WorkflowRun", "actions": [ { 
"_class": "hudson.model.ParametersAction", "parameters": [ { "_class": 
"hudson.model.TextParameterValue", "name": "rulesetid", "value": 
"62e11268999630f4a49295c4" }, { "_class": 
"hudson.model.TextParameterValue", "name": "environment", "value": "sit" }, 
{ "_class": "hudson.model.TextParameterValue", "name": "tranid", "value": 
"1234" } ] }, { "_class": 
"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction" } ], "number": 
243, "result": "SUCCESS", "url": 
"https://jenkins.myrepodigital.com/job/architecture-shared-services/job/myrepoio-io-rmaappetite_sit/243/";
 
}, { "_class": "org.jenkinsci.plugins.workflow.job.WorkflowRun", "actions": 
[ { "_class": "hudson.model.ParametersAction", "parameters": [ { "_class": 
"hudson.model.TextParameterValue", "name": "branch", "value": "sit" }, { 
"_class": "hudson.model.TextParameterValue", "name": "environment", 
"value": "sit" }, { "_class": "hudson.model.TextParameterValue", "name": 
"tranid", "value": "12345" } ] }, { "_class": 
"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction" } ], "number": 
243, "result": "SUCCESS", "url": 
"https://jenkins.myrepodigital.com/job/architecture-shared-services/job/myrepoio-io-rmaappetite_sit/243/";
 
} ] }

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/222db3a9-6f64-4b91-b63c-77cf03ead939n%40googlegroups.com.

Reply via email to