• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • jira-trigger-plugin
    • None

      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.

          [JENKINS-46798] Expose triggering comment as variable

          Wisen Tanasa added a comment -

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

          Wisen Tanasa added a comment - Can you describe your use cases more? How would you use this variable?

          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.

           

          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.  

          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.

          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.

          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.

          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.

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

              Created:
              Updated: