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

Starting a job using the API returns 302 instead of 201

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins: 2.138.1
      OS: Ubuntu 16.04.5 LTS
    • Similar Issues:

      Description

      Any time a job is started using the `/build` or `/buildWithParameters` URL (either via the job's page itself or via an API call), it always returns a `HTTP 302` response that redirects to the job's page, instead of the correct HTTP 201.

      This behavior contradicts the API documentation itself, which states:

      To programmatically schedule a new build, post to this URL (/build). If the build has parameters, post to this URL (/buildWithParameters) and provide the parameters as form data. Either way, the successful queueing will result in 201 status code with Location HTTP header pointing the URL of the item in the queue.

        Attachments

          Activity

          Hide
          macjohnny Esteban Marin added a comment -

          This seems to happen when building a "Pipeline" build. For normal builds, this does not occur.

          Show
          macjohnny Esteban Marin added a comment - This seems to happen when building a "Pipeline" build. For normal builds, this does not occur.
          Hide
          mrbq Marcos Rivas added a comment -

          I can confirm this is an issue, there is no possible way to obtain the build number of a pipeline job that has been launched by calling /build or /buildWithParameters endpoint

          Show
          mrbq Marcos Rivas added a comment - I can confirm this is an issue, there is no possible way to obtain the build number of a pipeline job that has been launched by calling /build or /buildWithParameters endpoint
          Hide
          techsmartsols Ardhendu Shekhar Singh added a comment -

          Hi Marcos Rivas/Jevgeni Nazander/Esteban Marin,

          Is there update on this issue?

          Regards,
          Ardhendu Singh

          Show
          techsmartsols Ardhendu Shekhar Singh added a comment - Hi Marcos Rivas / Jevgeni Nazander / Esteban Marin , Is there update on this issue? Regards, Ardhendu Singh

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jnazander Jevgeni Nazander
            Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated: