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

JIRA-plugin: configurable project key RX

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: plugin-proposals
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      It would be great if the pattern for the JIRA project key would be configurable
      so that non-standard project ID's could be matched.

      I think it's quite common to use numbers in project keys - especially if you
      have lots of projects.

        Attachments

          Issue Links

            Activity

            Hide
            gj gj added a comment -

            Another reason for this to be configurable:

            • we use the maven release plugin (not with hudson); it creates svn revisions with messages such as "[maven-release-plugin] prepare release magnolia-4.3-rc1"
            • hudson kicks in at some point, picks up this revision, and its default pattern being what it is, picks up "magnolia-4" out of the commit message, and tries to add a comment to that issue
            • that issue does not exist, and this makes the build fail.

            Either the regex should be configurable (I'd configure it to match

            {2,}

            digits after the dash, we have no projects with smaller issue IDs, and/or, the build should not fail when an issue does not exist. (and too bad if a developer uses the wrong issue id by accident)

            Show
            gj gj added a comment - Another reason for this to be configurable: we use the maven release plugin (not with hudson); it creates svn revisions with messages such as " [maven-release-plugin] prepare release magnolia-4.3-rc1" hudson kicks in at some point, picks up this revision, and its default pattern being what it is, picks up "magnolia-4" out of the commit message, and tries to add a comment to that issue that issue does not exist, and this makes the build fail. Either the regex should be configurable (I'd configure it to match {2,} digits after the dash, we have no projects with smaller issue IDs, and/or, the build should not fail when an issue does not exist. (and too bad if a developer uses the wrong issue id by accident)
            Hide
            hartmutl hartmutl added a comment -

            I also added support for underscores in the project pattern
            (Committed revision 20166.)
            This fixes issue 4092

            Show
            hartmutl hartmutl added a comment - I also added support for underscores in the project pattern (Committed revision 20166.) This fixes issue 4092
            Hide
            skraut skraut added a comment -

            I am experiencing this same set of problems, as the Jira plugin does not post to
            projects which are named entirely with numbers. I can confirm that it will post
            to an all letter project, or to a project which has letters and numbers.
            However it does not post to a project which is fully a number (our standard format)

            For instance the plugin is not able to determine the project number for the
            following commit log:

            4313-48 - Updated the default part number generated.

            yet it has no problem with a project made up with words.

            It looks like a Regex made up simply of "[A-Za-z0-9]+" would allow the Jira
            plugin to post to projects named only numbers.

            Show
            skraut skraut added a comment - I am experiencing this same set of problems, as the Jira plugin does not post to projects which are named entirely with numbers. I can confirm that it will post to an all letter project, or to a project which has letters and numbers. However it does not post to a project which is fully a number (our standard format) For instance the plugin is not able to determine the project number for the following commit log: 4313-48 - Updated the default part number generated. yet it has no problem with a project made up with words. It looks like a Regex made up simply of " [A-Za-z0-9] +" would allow the Jira plugin to post to projects named only numbers.
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            Implemented accordingly in 1.6.

            Show
            kohsuke Kohsuke Kawaguchi added a comment - Implemented accordingly in 1.6.
            Hide
            schup schup added a comment -

            I think that would be OK since allowing numbers is the one thing that would be
            needed most of the time. If I understand it correctly the project part of the
            detected issue id is checked against the list of available projects anyway - no
            need to worry about false positives than.

            Show
            schup schup added a comment - I think that would be OK since allowing numbers is the one thing that would be needed most of the time. If I understand it correctly the project part of the detected issue id is checked against the list of available projects anyway - no need to worry about false positives than.
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            I added http://jira.atlassian.com/browse/JRA-13404 so that this will be
            eventually available in JIRA.

            What if we just relax the regexp a bit in Hudson to include numerics (i.e.,
            "[A-Za-z][A-Za-z0-9]+")? Doesn't that cover 99.9% of the use case?

            Show
            kohsuke Kohsuke Kawaguchi added a comment - I added http://jira.atlassian.com/browse/JRA-13404 so that this will be eventually available in JIRA. What if we just relax the regexp a bit in Hudson to include numerics (i.e., " [A-Za-z] [A-Za-z0-9] +")? Doesn't that cover 99.9% of the use case?
            Hide
            schup schup added a comment -

            This is a configuration option in JIRA: jira.projectkey.pattern
            It needs to be set in jira-application.properties.
            http://confluence.atlassian.com/display/JIRA/Advanced+JIRA+configuration+with+jira-application.properties

            I had a quick look at the JIRA web service but I don't think you can get the
            jira.projectkye.pattern from the service (getConfiguration). In my opinion this
            would be the best solution. If JIRA supported this there would be no need to
            configure the regular expression - it could be picked up automatically.

            The alternative I see at the moment is adding a new property to the JIRA Site
            configuration in Hudson.

            Anything I can assist you with?

            ps:
            There are a couple of requests in the JIRA issue tracker and forum to allow
            alphanumeric project keys:
            http://forum.atlassian.com/thread.jspa?threadID=12333
            http://jira.atlassian.com/browse/JRA-861
            http://jira.atlassian.com/browse/JRA-3621
            http://jira.atlassian.com/browse/JRA-7157
            http://jira.atlassian.com/browse/JRA-7633
            http://jira.atlassian.com/browse/JRA-8608

            Show
            schup schup added a comment - This is a configuration option in JIRA: jira.projectkey.pattern It needs to be set in jira-application.properties. http://confluence.atlassian.com/display/JIRA/Advanced+JIRA+configuration+with+jira-application.properties I had a quick look at the JIRA web service but I don't think you can get the jira.projectkye.pattern from the service (getConfiguration). In my opinion this would be the best solution. If JIRA supported this there would be no need to configure the regular expression - it could be picked up automatically. The alternative I see at the moment is adding a new property to the JIRA Site configuration in Hudson. Anything I can assist you with? ps: There are a couple of requests in the JIRA issue tracker and forum to allow alphanumeric project keys: http://forum.atlassian.com/thread.jspa?threadID=12333 http://jira.atlassian.com/browse/JRA-861 http://jira.atlassian.com/browse/JRA-3621 http://jira.atlassian.com/browse/JRA-7157 http://jira.atlassian.com/browse/JRA-7633 http://jira.atlassian.com/browse/JRA-8608
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            I tried to create a new project in JIRA with numbers in project key (like
            XYZ123) but JIRA refused to create one.

            Is it really true that "it's quite common to user numbers in project keys"? I
            mean, I can't even create one.

            If you still think we should fix this, please reopen the issue.

            Show
            kohsuke Kohsuke Kawaguchi added a comment - I tried to create a new project in JIRA with numbers in project key (like XYZ123) but JIRA refused to create one. Is it really true that "it's quite common to user numbers in project keys"? I mean, I can't even create one. If you still think we should fix this, please reopen the issue.

              People

              • Assignee:
                olamy Olivier Lamy
                Reporter:
                schup schup
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: