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

Expose triggering comment as variable

    Details

    • Similar Issues:

      Description

      Hi Wisen,

      Can I request that the jira_trigger plugin be extended to expose as a variable the comment triggering a Jenkins build when the 'Build when a comment is added to JIRA' optionis selected.

      This would enhance the possibilities and usability of the plugin greatly.

      Alternately allow resolution against the comment shape response.

      Looking forward to your comments.

      Thanks and regards.

        Attachments

          Activity

          Hide
          ceilfors Wisen Tanasa added a comment -

          Can you describe your use cases more? How would you use this variable?

          Show
          ceilfors Wisen Tanasa added a comment - Can you describe your use cases more? How would you use this variable?
          Hide
          mgreville Marcus Greville added a comment -

          Hi Wisen,

          My use case is to trigger an Artifactory object promotion job from a JIRA comment.

          promote this build #35

          I want the comment as an environment variable for easy parsing to extract the build number.

          This is the only way I can see to link the required build number and the JIRA issue.

          Despite reporting earlier not being able to extract custom fields, in our organisation we are prohibited from actually using them so this is not an option.

          Apart from this use case I think the general ability to create conditional Jenkins workflows on the basis of the JIRA comment would be invaluable.

          Thanks and regards.

           

          Show
          mgreville Marcus Greville added a comment - Hi Wisen, My use case is to trigger an Artifactory object promotion job from a JIRA comment. promote this build #35 I want the comment as an environment variable for easy parsing to extract the build number. This is the only way I can see to link the required build number and the JIRA issue. Despite reporting earlier not being able to extract custom fields, in our organisation we are prohibited from actually using them so this is not an option. Apart from this use case I think the general ability to create conditional Jenkins workflows on the basis of the JIRA comment would be invaluable. Thanks and regards.  
          Hide
          ceilfors Wisen Tanasa added a comment -

          I don't think I understand what you mean by "conditional Jenkins workflow". If I understand this correctly, basically the feature request is:
          When: Jenkins job is triggered by a JIRA comment
          Then: JIRA_NEW_COMMENT environment variable should be injected to the build
          And: It should contain the comment that has been added to JIRA

          Please CMIIW.

          For workaround, you should be able to hit JIRA REST API with the JIRA_ISSUE_KEY information and grab the latest comment.

          Show
          ceilfors Wisen Tanasa added a comment - I don't think I understand what you mean by "conditional Jenkins workflow". If I understand this correctly, basically the feature request is: When: Jenkins job is triggered by a JIRA comment Then: JIRA_NEW_COMMENT environment variable should be injected to the build And: It should contain the comment that has been added to JIRA Please CMIIW. For workaround, you should be able to hit JIRA REST API with the JIRA_ISSUE_KEY information and grab the latest comment.
          Hide
          mgreville Marcus Greville added a comment -

          You have summarised this request perfectly.

           

          By conditional workflow I mean only that the content of the comment can then be used to control the internal logic of, e.g. a shell script.

          If JIRA_NEW_COMMENT regex contains 'x' do this, or if contains 'y' do that..

          The work around is fine for now.

          Show
          mgreville Marcus Greville added a comment - You have summarised this request perfectly.   By conditional workflow I mean only that the content of the comment can then be used to control the internal logic of, e.g. a shell script. If JIRA_NEW_COMMENT regex contains 'x' do this, or if contains 'y' do that.. The work around is fine for now.

            People

            • Assignee:
              ceilfors Wisen Tanasa
              Reporter:
              mgreville Marcus Greville
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: