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

Unable to toggle favorite for (pipeline) jobs with slash in their name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • favorite-plugin
    • None

      URI encoded characters (such as forward slashes) are decoded when they should not be, preventing jobs with such characters in their names from being manually added/removed from the favorites list.

      A job in a multi-branch pipeline where the branch has a slash in its name would result in a job named parent-job/git%2Fbranch-name, but on the backend the plugin looks for a job named parent-job/git/branch-name and fails:

      WARNING: Error while serving http://buildserver/plugin/favorite/toggleFavorite
      java.lang.reflect.InvocationTargetException
          ...
      Caused by: java.lang.IllegalArgumentException: Item <parent-job/git/branch-name> does not exist
          at hudson.plugins.favorite.FavoritePlugin.getItem(FavoritePlugin.java:71)
          at hudson.plugins.favorite.FavoritePlugin.doToggleFavorite(FavoritePlugin.java:29)
          at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
          at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
          ... 90 more

            davidparsson David Pärsson
            davidparsson David Pärsson
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: