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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • jira-ext-plugin
    • None

      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. 

       

       

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

              Created:
              Updated: