question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to display data returned from Jenkins

See original GitHub issue

Hello!

I’m trying to parse this data:

{ "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowJob", "builds" : [ { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 220, "result" : "SUCCESS" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 219, "result" : "UNSTABLE" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 218, "result" : "ABORTED" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 217, "result" : "UNSTABLE" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 216, "result" : "UNSTABLE" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 215, "result" : "ABORTED" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 214, "result" : "UNSTABLE" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 213, "result" : "ABORTED" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 212, "result" : "ABORTED" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 211, "result" : "UNSTABLE" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 210, "result" : "ABORTED" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 209, "result" : "SUCCESS" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 208, "result" : "UNSTABLE" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 207, "result" : "ABORTED" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 206, "result" : "ABORTED" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 205, "result" : "SUCCESS" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 204, "result" : "SUCCESS" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 203, "result" : "SUCCESS" }, { "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun", "number" : 202, "result" : "ABORTED" } ] }

Trying to use these queries, but I get an error. I’m sure it’s something stupid! image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kalpikcommented, Nov 27, 2020

Thank you 😃

1reaction
kalpikcommented, Nov 20, 2020

Here you go:

URL: https://my-jenkins-instance.com/job/Cloud/job/attempt_iqa_promotion/job/develop/api/json

Query Parameters actual (which broke): pretty=true&tree=builds[number,result,url]{0,10} URL Encoded (which work): pretty=true&tree=builds%5Bnumber%2Cresult%2Curl%5D%7B0%2C10%7D

Note that if I also encode ‘=’ and ‘&’, it doesn’t work again. So only some parts need to be URL encoded.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get failure reason from Jenkins pipeline
If an error occurs, it will set build.result to FAILURE, and continue the build. See catchError , which points out that only the...
Read more >
Diagnosing Errors
This page provides guidelines about diagnosing the most common types of errors you may see when using Jenkins. Out Of Memory Errors. OutOfMemoryError...
Read more >
Allow sh to return exit status, stdout and stderr all at once
I tried to implement a Java function which executes another arbitrary Java code of the given node, but it does not work directly...
Read more >
Pipeline: Basic Steps
If the shell step fails, the Pipeline build's status will be set to failed, so that the subsequent mail step will see that...
Read more >
Declarative Pipeline shows SUCCESS even though job ...
I'm experiencing the same. currentBuild.currentResult for all failed and aborted builds returns "SUCCESS". Same when using $BUILD_STATUS through the emailext ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found