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

When Updating JIRA Comments mentionedInCommitStrategy does not pick up on JIRA not specified on first line of commit

    Details

    • Similar Issues:

      Description

      The class AbstractParsingIssueStrategy uses:

      ChangeLogSet changeSets = build.getChangeSet();

      The class that represents the ChangeLogSet is:

      ChangeLogSet class: class hudson.plugins.git.GitChangeSetList

      which is output in the build.

       

      In the GitChangeSet class getMsg returns the title or the first line of the commit 

      @Exported
      public String getMsg() {
       return this.title;
      }

      Which is what is used in MentionedInCommitStrategy:

       

      @Override
      public List<JiraCommit> getJiraIssuesFromChangeSet(final ChangeLogSet.Entry change)
      {
       final List<JiraCommit> result = new ArrayList<>();
       final List<String> foundTickets = new ArrayList<>();
      
       for (String validJiraPrefix : Config.getGlobalConfig().getJiraTickets())
       {
       String msg = change.getMsg();
      ...
      

       

      The problem is our git commit standards specify having the JIRA at the end, for example:

       

      Upgraded Docker Image
      See JAS-1234
      

       

      so what is getting passed is the first line, and the mentionedInCommitStrategy does not pick up any JIRA.

      Perhaps if the ChangeLogSet.Entry class in jenkins cored exposed getComment this could be used instead in mentionedInCommitStrategy. 

       

       

        Attachments

          Issue Links

            Activity

            Hide
            benkletzine Ben Kletzine added a comment -

            Just realized that maybe there is an issue with a git related plugin will also investigate 

            Show
            benkletzine Ben Kletzine added a comment - Just realized that maybe there is an issue with a git related plugin will also investigate 
            Hide
            vrnsky Egor Voronyansky added a comment -

            Ben Kletzine so if issue resolved close it please. Because it was found by open issues

            Show
            vrnsky Egor Voronyansky added a comment - Ben Kletzine so if issue resolved close it please. Because it was found by open issues

              People

              • Assignee:
                dalvizu Dan Alvizu
                Reporter:
                benkletzine Ben Kletzine
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: