{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/comments/37710799","id":37710799,"diff_hunk":"@@ -160,33 +206,50 @@ public String getHelpFile() {\n         public ParameterDefinition newInstance(StaplerRequest req, JSONObject formData) throws FormException {\n             return req.bindJSON(PromotedBuildParameterDefinition.class, formData);\n         }\n-\n+        \n         /**\n          * Checks the job name.\n          */\n         public FormValidation doCheckJobName(@AncestorInPath Item project, @QueryParameter String value ) {\n+            final Jenkins jenkins = Jenkins.getInstance();\n+            if (jenkins == null) {\n+                return FormValidation.error(\"Jenkins instance is not ready\");\n+            }\n             if (!project.hasPermission(Item.CONFIGURE) && project.hasPermission(Item.EXTENDED_READ)) {\n                 return FormValidation.ok();\n             }\n+            \n             project.checkPermission(Item.CONFIGURE);\n \n             if (StringUtils.isNotBlank(value)) {\n-                AbstractProject p = Jenkins.getInstance().getItem(value,project,AbstractProject.class);\n-                if(p==null)\n+                // JENKINS-25011: also look for jobs in folders.\n+                final AbstractProject p = ItemPathResolver.getByPath(value, project, AbstractProject.class);\n+                if (p==null) {","path":"src/main/java/hudson/plugins/promoted_builds/parameters/PromotedBuildParameterDefinition.java","position":173,"original_position":173,"commit_id":"dfb5559a9f3bbf73befdc918fc7286b8cbe826bb","original_commit_id":"a79024b1c8a5c058e26cdb0a6c2f8c420e128432","user":{"login":"recena","id":1021745,"avatar_url":"https://avatars.githubusercontent.com/u/1021745?v=3","gravatar_id":"","url":"https://api.github.com/users/recena","html_url":"https://github.com/recena","followers_url":"https://api.github.com/users/recena/followers","following_url":"https://api.github.com/users/recena/following{/other_user}","gists_url":"https://api.github.com/users/recena/gists{/gist_id}","starred_url":"https://api.github.com/users/recena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/recena/subscriptions","organizations_url":"https://api.github.com/users/recena/orgs","repos_url":"https://api.github.com/users/recena/repos","events_url":"https://api.github.com/users/recena/events{/privacy}","received_events_url":"https://api.github.com/users/recena/received_events","type":"User","site_admin":false},"body":"@KostyaSha @oleg-nenashev But up to you. I commented this PR before this weekend. I don't want to spend time in this kind of things.","created_at":"2015-08-23T21:33:34Z","updated_at":"2015-08-23T21:33:34Z","html_url":"https://github.com/jenkinsci/promoted-builds-plugin/pull/62#discussion_r37710799","pull_request_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/comments/37710799"},"html":{"href":"https://github.com/jenkinsci/promoted-builds-plugin/pull/62#discussion_r37710799"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/62","id":41355966,"html_url":"https://github.com/jenkinsci/promoted-builds-plugin/pull/62","diff_url":"https://github.com/jenkinsci/promoted-builds-plugin/pull/62.diff","patch_url":"https://github.com/jenkinsci/promoted-builds-plugin/pull/62.patch","issue_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/62","number":62,"state":"closed","locked":false,"title":"[JENKINS-25011] - Folders and the relative addressing support","user":{"login":"oleg-nenashev","id":3000480,"avatar_url":"https://avatars.githubusercontent.com/u/3000480?v=3","gravatar_id":"","url":"https://api.github.com/users/oleg-nenashev","html_url":"https://github.com/oleg-nenashev","followers_url":"https://api.github.com/users/oleg-nenashev/followers","following_url":"https://api.github.com/users/oleg-nenashev/following{/other_user}","gists_url":"https://api.github.com/users/oleg-nenashev/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-nenashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-nenashev/subscriptions","organizations_url":"https://api.github.com/users/oleg-nenashev/orgs","repos_url":"https://api.github.com/users/oleg-nenashev/repos","events_url":"https://api.github.com/users/oleg-nenashev/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-nenashev/received_events","type":"User","site_admin":false},"body":"Follow-up to https://github.com/jenkinsci/promoted-builds-plugin/pull/47\r\n\r\n- [x] Resolution by full names (initial implementation by @dnozay )\r\n- [x] Intelligent handling of absolute and relative paths\r\n- Nice2have: Get the confirmation from @daniel-beck that the fix addresses his concerns\r\n- [x] Unit tests\r\n\r\n@daniel-beck , Is it what you would like to see in the plugin?","created_at":"2015-07-31T16:20:26Z","updated_at":"2015-08-23T21:33:34Z","closed_at":"2015-08-21T07:43:39Z","merged_at":"2015-08-21T07:43:39Z","merge_commit_sha":"6d1c8aa907013414760a84b176f9ca5367f0377b","assignee":null,"milestone":{"url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/milestones/1","html_url":"https://github.com/jenkinsci/promoted-builds-plugin/milestones/2.22","labels_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/milestones/1/labels","id":1261967,"number":1,"title":"2.22","description":"","creator":{"login":"oleg-nenashev","id":3000480,"avatar_url":"https://avatars.githubusercontent.com/u/3000480?v=3","gravatar_id":"","url":"https://api.github.com/users/oleg-nenashev","html_url":"https://github.com/oleg-nenashev","followers_url":"https://api.github.com/users/oleg-nenashev/followers","following_url":"https://api.github.com/users/oleg-nenashev/following{/other_user}","gists_url":"https://api.github.com/users/oleg-nenashev/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-nenashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-nenashev/subscriptions","organizations_url":"https://api.github.com/users/oleg-nenashev/orgs","repos_url":"https://api.github.com/users/oleg-nenashev/repos","events_url":"https://api.github.com/users/oleg-nenashev/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-nenashev/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":6,"state":"open","created_at":"2015-08-19T05:35:32Z","updated_at":"2015-08-21T07:43:39Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/62/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/62/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/62/comments","statuses_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/statuses/dfb5559a9f3bbf73befdc918fc7286b8cbe826bb","head":{"label":"oleg-nenashev:JENKINS-25011","ref":"JENKINS-25011","sha":"dfb5559a9f3bbf73befdc918fc7286b8cbe826bb","user":{"login":"oleg-nenashev","id":3000480,"avatar_url":"https://avatars.githubusercontent.com/u/3000480?v=3","gravatar_id":"","url":"https://api.github.com/users/oleg-nenashev","html_url":"https://github.com/oleg-nenashev","followers_url":"https://api.github.com/users/oleg-nenashev/followers","following_url":"https://api.github.com/users/oleg-nenashev/following{/other_user}","gists_url":"https://api.github.com/users/oleg-nenashev/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-nenashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-nenashev/subscriptions","organizations_url":"https://api.github.com/users/oleg-nenashev/orgs","repos_url":"https://api.github.com/users/oleg-nenashev/repos","events_url":"https://api.github.com/users/oleg-nenashev/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-nenashev/received_events","type":"User","site_admin":false},"repo":{"id":39235435,"name":"promoted-builds-plugin","full_name":"oleg-nenashev/promoted-builds-plugin","owner":{"login":"oleg-nenashev","id":3000480,"avatar_url":"https://avatars.githubusercontent.com/u/3000480?v=3","gravatar_id":"","url":"https://api.github.com/users/oleg-nenashev","html_url":"https://github.com/oleg-nenashev","followers_url":"https://api.github.com/users/oleg-nenashev/followers","following_url":"https://api.github.com/users/oleg-nenashev/following{/other_user}","gists_url":"https://api.github.com/users/oleg-nenashev/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-nenashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-nenashev/subscriptions","organizations_url":"https://api.github.com/users/oleg-nenashev/orgs","repos_url":"https://api.github.com/users/oleg-nenashev/repos","events_url":"https://api.github.com/users/oleg-nenashev/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-nenashev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oleg-nenashev/promoted-builds-plugin","description":"Jenkins promoted-builds plugin","fork":true,"url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin","forks_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/forks","keys_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/teams","hooks_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/hooks","issue_events_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/events","assignees_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/tags","blobs_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/languages","stargazers_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/stargazers","contributors_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/contributors","subscribers_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/subscribers","subscription_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/subscription","commits_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/merges","archive_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/downloads","issues_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/labels{/name}","releases_url":"https://api.github.com/repos/oleg-nenashev/promoted-builds-plugin/releases{/id}","created_at":"2015-07-17T04:49:16Z","updated_at":"2015-07-17T04:49:17Z","pushed_at":"2015-08-21T07:32:16Z","git_url":"git://github.com/oleg-nenashev/promoted-builds-plugin.git","ssh_url":"git@github.com:oleg-nenashev/promoted-builds-plugin.git","clone_url":"https://github.com/oleg-nenashev/promoted-builds-plugin.git","svn_url":"https://github.com/oleg-nenashev/promoted-builds-plugin","homepage":"http://jenkins-ci.org/","size":786,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"0a0a5697bad53509533af09d9f1cf35f2d5f572e","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":1163731,"name":"promoted-builds-plugin","full_name":"jenkinsci/promoted-builds-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/promoted-builds-plugin","description":"Jenkins promoted-builds plugin","fork":false,"url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin","forks_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/releases{/id}","created_at":"2010-12-13T05:51:37Z","updated_at":"2015-08-20T22:13:26Z","pushed_at":"2015-08-21T10:58:56Z","git_url":"git://github.com/jenkinsci/promoted-builds-plugin.git","ssh_url":"git@github.com:jenkinsci/promoted-builds-plugin.git","clone_url":"https://github.com/jenkinsci/promoted-builds-plugin.git","svn_url":"https://github.com/jenkinsci/promoted-builds-plugin","homepage":"http://jenkins-ci.org/","size":1906,"stargazers_count":54,"watchers_count":54,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":84,"mirror_url":null,"open_issues_count":5,"forks":84,"open_issues":5,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/62"},"html":{"href":"https://github.com/jenkinsci/promoted-builds-plugin/pull/62"},"issue":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/62"},"comments":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/promoted-builds-plugin/statuses/dfb5559a9f3bbf73befdc918fc7286b8cbe826bb"}}}}