Any approach can tell job build is paused or not?

This issue is archived. You can view it, but you can't modify it. Learn more

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

            Assignee:
            Unassigned
            Reporter:
            litong deng
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: