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

buildWithParameters: return a JSON string when client request it through content-type header

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Jenkins 1.460 on Debian Squeeze

      Right now, every call on the buildWithParameters URL will always redirect to the job page on success. If this API is queried through an Ajax call, it should return a JSON output of the current job instead. This can easily be detected based on the Content-Type http header sent by the client.

      This is useful for example if one wants to trigger a parametrized build from jQuery, and parse the result. Right now, jQuery will always get back the HTML page of the job, which makes it hard to do any error handling.

          [JENKINS-13546] buildWithParameters: return a JSON string when client request it through content-type header

          Reynald Borer created issue -
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Sune Keller made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Bertrand Roussel made changes -
          Status Original: Reopened [ 4 ] New: In Progress [ 3 ]
          Bertrand Roussel made changes -
          Assignee New: Bertrand Roussel [ corfr ]
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Andrew Kujtan made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Daniel Beck made changes -
          Link New: This issue is related to JENKINS-22865 [ JENKINS-22865 ]
          Daniel Beck made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Reopened [ 4 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 144012 ] New: JNJira + In-Review [ 190858 ]

            corfr Bertrand Roussel
            rborer Reynald Borer
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: