Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56556

Any approach can tell job build is paused or not?

XMLWordPrintable

      well, let me describe my situation:

      i use pipeline and i can see the left-side button Pause/Resume, which will trigger api /job/{$job_name}/${build_num}/pause/toggle, and it will pause if it's running(that's, no paused), or will resume if it's paused. now my question is how can i get the status whether the job build is paused or not, it's really matter for me as i want to add a Pause/Resume button on 3-rd platform, to control the build runs.

      I search a lot and finally found that it's the class CpsFlowExecution perform the action in plugin workflow-cps-plugin, they are bool isPaused() and pause(boolean v) function. so how can i get the isPaused() status outside the job build page in Jenkins? Any REST API, groovy script, or any other plugin is ok, for that i found i even could't found some such groovy script to get the CpsFlowExecution of the build.

      i have spent days of time to search and search for the answer, help me please, much appreciated!

       

      https://javadoc.jenkins.io/plugin/workflow-cps/index.html?org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.html

            Unassigned Unassigned
            denglitong litong deng
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: