Skip to content

[JENKINS-7004] cause not working in parameterized projects #19694

Closed

Description

@jenkins-infra-bot

The documentation in trigger builds remotely says

Optionally append &cause=Cause+Text to provide text that will be included in the recorded build cause.

The cause doesn't work for parameterized builds.

Also the documentation should state that the trigger URL in that case has buildWithParameters not build...

Already requested in wiki


Originally reported by anshnd, imported from: cause not working in parameterized projects
  • assignee: mindless
  • status: Closed
  • priority: Minor
  • component(s): core
  • resolution: Fixed
  • resolved: 2010-07-18T08:59:03+00:00
  • votes: 0
  • watchers: 3
  • imported: 2025-11-24
Raw content of original issue

The documentation in trigger builds remotely says

Optionally append &cause=Cause+Text to provide text that will be included in the recorded build cause.

The cause doesn't work for parameterized builds.

Also the documentation should state that the trigger URL in that case has buildWithParameters not build...

Already requested in wiki

1 attachment

Activity

  1. jenkins-infra-bot commented on Jul 16, 2010

    @jenkins-infra-bot
    Author
    anshnd:
    • Original comment link
    • Raw content of original comment:

      assigning to parameters and not to unrelated parameterized-trigger

    assigning to parameters and not to unrelated parameterized-trigger

  2. jenkins-infra-bot commented on Jul 18, 2010

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java trunk/hudson/main/core/src/main/java/hudson/model/ParametersDefinitionProperty.java trunk/hudson/main/core/src/main/resources/hudson/model/BuildAuthorizationToken/config.jelly trunk/www/changelog.html http://jenkins-ci.org/commit/33032 Log: [FIXED JENKINS-7004] Make /buildWithParameters support remote cause and user supplied cause text for build via authentication token, just as /build does.

    Code changed in hudson
    User: : mindless
    Path:
    trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java
    trunk/hudson/main/core/src/main/java/hudson/model/ParametersDefinitionProperty.java
    trunk/hudson/main/core/src/main/resources/hudson/model/BuildAuthorizationToken/config.jelly
    trunk/www/changelog.html
    http://jenkins-ci.org/commit/33032
    Log:
    [FIXED JENKINS-7004] Make /buildWithParameters support remote cause and
    user supplied cause text for build via authentication token, just as /build does.

  3. jenkins-infra-bot commented on Nov 20, 2012

    @jenkins-infra-bot
    Author
    amonsen:
    • Original comment link
    • Raw content of original comment:

      FYI, it appears cause must follow token in the query string or cause is discarded. For example:

      ?token=x&cause=y

      works, but

      ?cause=y&token=x

      discards cause.

    FYI, it appears cause must follow token in the query string or cause is discarded. For example:

    ?token=x&cause=y

    works, but

    ?cause=y&token=x

    discards cause.

  4. jenkins-infra-bot commented on Apr 9, 2015

    @jenkins-infra-bot
    Author
    nakilon:
    • Original comment link
    • Raw content of original comment:

      Probably I have similar issue when passing credentials via base auth, not token.

    Probably I have similar issue when passing credentials via base auth, not token.

  5. jenkins-infra-bot commented on Feb 6, 2019

    @jenkins-infra-bot
    Author
    solvingj:
    • Original comment link
    • Raw content of original comment:

      We've done some testing and reviewed the commits, and the Cause field does not seem to be fully supported on parameterized builds.   As nakilon has said, the `cause` field does not work at all when using http auth via header or URL.  The job MUST have a `token` assigned, and as amonsen has said, it MUST come before the `cause` parameter.

      I suggest reopening this ticket.

    We've done some testing and reviewed the commits, and the Cause field does not seem to be fully supported on parameterized builds.   As nakilon has said, the `cause` field does not work at all when using http auth via header or URL.  The job MUST have a `token` assigned, and as amonsen has said, it MUST come before the `cause` parameter.

    I suggest reopening this ticket.

  6. jenkins-infra-bot commented on Mar 7, 2019

    @jenkins-infra-bot
    Author
    danielbeck:
    • Original comment link
    • Raw content of original comment:

      The job MUST have a `token` assigned

      This feature only exists for triggering builds via token and nowhere else, which is why it is part of that feature's documentation. Adding it elsewhere would be a feature request.

    The job MUST have a `token` assigned

    This feature only exists for triggering builds via token and nowhere else, which is why it is part of that feature's documentation. Adding it elsewhere would be a feature request.

  7. jenkins-infra-bot commented on Mar 10, 2019

    @jenkins-infra-bot
    Author
    cvijayan:
    • Original comment link
    • Raw content of original comment:

      My intent is to figure out if there is a way to monitor a job invocation accurately by either using the Queue ID returned as part of the Location and then retrieving the Build ID  OR by passing a unique identifier to the Cause parameter.

      What I find weird is that when there is a Quiet period in effect neither the Queue ID nor the Cause parameter behave as expected. Please see the attached sample test harness and its output. 

      There are 3 jobs invoked in parallel each a unique identifier for cause. This is is the outcome.

      A. First job gets a successful build, the other 2 don't (presumably because of the Quiet period).

      B.  The First job is queryable through the Queue ID and the response does have the unique identifier passed in Cause. 

      C. However the second and third invocations get a status of 201 and have the same Queue ID of the first, with the response having all the 3 causes. 

       

        

    My intent is to figure out if there is a way to monitor a job invocation accurately by either using the Queue ID returned as part of the Location and then retrieving the Build ID  OR by passing a unique identifier to the Cause parameter.

    What I find weird is that when there is a Quiet period in effect neither the Queue ID nor the Cause parameter behave as expected. Please see the attached sample test harness and its output. 

    There are 3 jobs invoked in parallel each a unique identifier for cause. This is is the outcome.

    A. First job gets a successful build, the other 2 don't (presumably because of the Quiet period).

    B.  The First job is queryable through the Queue ID and the response does have the unique identifier passed in Cause. 

    C. However the second and third invocations get a status of 201 and have the same Queue ID of the first, with the response having all the 3 causes. 

     

      

  8. jenkins-infra-bot commented on Mar 10, 2019

    @jenkins-infra-bot
    Author
    cvijayan:
    • Original comment link
    • Raw content of original comment:

      Should I open a new ticket or reopen this ticket  ?

    Should I open a new ticket or reopen this ticket  ?

  9. jenkins-infra-bot commented on Mar 10, 2019

    @jenkins-infra-bot
    Author
    danielbeck:
    • Original comment link
    • Raw content of original comment:

      The behavior described above is as designed, queue items are combined when they're considered identical, and causes combined as well. So if you pass the same build parameters (the Magic "cause" is not one of them) they will be combined.

    The behavior described above is as designed, queue items are combined when they're considered identical, and causes combined as well. So if you pass the same build parameters (the Magic "cause" is not one of them) they will be combined.

  10. jenkins-infra-bot commented on Mar 11, 2019

    @jenkins-infra-bot
    Author
    cvijayan:
    • Original comment link
    • Raw content of original comment:

      In the above case when the queue items are combined is there any way to know that they are combined from the response when they are invoked ?  All of them return a http status code of 201 (= Resource Created), so for sure this doesn't help.

       

       

    In the above case when the queue items are combined is there any way to know that they are combined from the response when they are invoked ?  All of them return a http status code of 201 (= Resource Created), so for sure this doesn't help.

     

     

  11. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions