Re: Jenkins selected filtering values in parameter objects

2022-10-27 Thread Chennai Cheetah
hi db,

I tried with xml api  below is my url

https://jenkins.myrepo.com/job/architecture-shared-services/job/loanrules_sit/api/xml?tree=builds[number,url,result,actions[parameters[name,value]]]=true=//parameter[name=%27rulesetid%27%20and%20value=%27635aa36a3f80310ae7e36c87%27]=builds

It returns 



rulesetid
635aa36a3f80310ae7e36c87



How do I get number, url, result tags in the response?


On Thursday, 27 October 2022 at 20:36:01 UTC+5:30 db...@cloudbees.com wrote:

> On Thu, Oct 27, 2022 at 3:39 PM Chennai Cheetah  
> wrote:
>
>> How do I get only selected jenkins information from the API response.
>>
> …
>>
> How do I filter rulesetid,branch details only from the parameter object, 
>> while rest of the parameters are not required in the response.
>>
> Work with the XML API output and use an XPath expression, or process the 
> JSON API responses using a tool like jq.
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/36146459-3b3f-4063-866f-1b008c97b9b1n%40googlegroups.com.


Re: Jenkins selected filtering values in parameter objects

2022-10-27 Thread 'Daniel Beck' via Jenkins Users
On Thu, Oct 27, 2022 at 3:39 PM Chennai Cheetah 
wrote:

> How do I get only selected jenkins information from the API response.
>
> …
>
> How do I filter rulesetid,branch details only from the parameter object,
> while rest of the parameters are not required in the response.
>
Work with the XML API output and use an XPath expression, or process the
JSON API responses using a tool like jq.

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAMo7PtJOoPVU9Lop%2BTFL9%2BEALVF2uVgcewkEp240DxCp%2BVBGHA%40mail.gmail.com.


Jenkins selected filtering values in parameter objects

2022-10-27 Thread Chennai Cheetah


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]]]=true{0,2}
 
*

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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/222db3a9-6f64-4b91-b63c-77cf03ead939n%40googlegroups.com.