{"action":"created","comment":{"url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/comments/29620302","id":29620302,"diff_hunk":"@@ -629,6 +629,29 @@ global with sharing class VOL_SharedCode {\n \t\t        } \n \t\t    }\n \t}\n+    // This massively nested SOQL where statement looks hard coded and dumb, but as it turns out\n+    // there's a limit on number of campaign hierarchy levels anyway, so this isn't as dumb as it \n+    // seems. This method will get all campaigns in hierarchy, and keeps the logic in a single query\n+\n+    /*******************************************************************************************************\n+    * @description Static method that takes an Id\n+    * Return a list of Campaign Ids that are children/grand-children &c of the given Campaign.\n+    * @param Id for any campaign \n+    * @return List<Id> of child campaigns\n+    ********************************************************************************************************/\n+\n+    global static List<Id> listIdsCampaignsInHierarchy(Id campaignId) {\n+        Map<Id,Campaign> campaignsInHierarchy = new Map<Id,Campaign>(\n+            [SELECT Id,Name FROM Campaign WHERE IsActive =:true AND ","path":"src/classes/VOL_SharedCode.cls","position":17,"original_position":17,"commit_id":"482959df9e49200773ed326a73bbfc5b6ea00a23","original_commit_id":"482959df9e49200773ed326a73bbfc5b6ea00a23","user":{"login":"cdcarter","id":164,"avatar_url":"https://avatars.githubusercontent.com/u/164?v=3","gravatar_id":"","url":"https://api.github.com/users/cdcarter","html_url":"https://github.com/cdcarter","followers_url":"https://api.github.com/users/cdcarter/followers","following_url":"https://api.github.com/users/cdcarter/following{/other_user}","gists_url":"https://api.github.com/users/cdcarter/gists{/gist_id}","starred_url":"https://api.github.com/users/cdcarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdcarter/subscriptions","organizations_url":"https://api.github.com/users/cdcarter/orgs","repos_url":"https://api.github.com/users/cdcarter/repos","events_url":"https://api.github.com/users/cdcarter/events{/privacy}","received_events_url":"https://api.github.com/users/cdcarter/received_events","type":"User","site_admin":false},"body":"You're right, that'd be an appropriate thing. I'll adjust and resubmit.","created_at":"2015-05-04T20:29:46Z","updated_at":"2015-05-04T20:29:46Z","html_url":"https://github.com/davidhabib/Volunteers-for-Salesforce/pull/144#discussion_r29620302","pull_request_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/144","_links":{"self":{"href":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/comments/29620302"},"html":{"href":"https://github.com/davidhabib/Volunteers-for-Salesforce/pull/144#discussion_r29620302"},"pull_request":{"href":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/144"}}},"pull_request":{"url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/144","id":34572260,"html_url":"https://github.com/davidhabib/Volunteers-for-Salesforce/pull/144","diff_url":"https://github.com/davidhabib/Volunteers-for-Salesforce/pull/144.diff","patch_url":"https://github.com/davidhabib/Volunteers-for-Salesforce/pull/144.patch","issue_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/issues/144","number":144,"state":"open","locked":false,"title":"Filter with Parent Campaign in JobListing/JobListingFS","user":{"login":"cdcarter","id":164,"avatar_url":"https://avatars.githubusercontent.com/u/164?v=3","gravatar_id":"","url":"https://api.github.com/users/cdcarter","html_url":"https://github.com/cdcarter","followers_url":"https://api.github.com/users/cdcarter/followers","following_url":"https://api.github.com/users/cdcarter/following{/other_user}","gists_url":"https://api.github.com/users/cdcarter/gists{/gist_id}","starred_url":"https://api.github.com/users/cdcarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdcarter/subscriptions","organizations_url":"https://api.github.com/users/cdcarter/orgs","repos_url":"https://api.github.com/users/cdcarter/repos","events_url":"https://api.github.com/users/cdcarter/events{/privacy}","received_events_url":"https://api.github.com/users/cdcarter/received_events","type":"User","site_admin":false},"body":"To partially close #141, this adds a ShowCampaignHierarchy boolean query flag, that when set, will show all jobs in all child/grandchild/greatgrandchild/etc... campaigns.","created_at":"2015-05-01T22:21:16Z","updated_at":"2015-05-04T20:29:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0072770f1a4c1c1229e212b06e7b05ca17106b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/144/commits","review_comments_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/144/comments","review_comment_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/issues/144/comments","statuses_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/statuses/482959df9e49200773ed326a73bbfc5b6ea00a23","head":{"label":"cdcarter:ch","ref":"ch","sha":"482959df9e49200773ed326a73bbfc5b6ea00a23","user":{"login":"cdcarter","id":164,"avatar_url":"https://avatars.githubusercontent.com/u/164?v=3","gravatar_id":"","url":"https://api.github.com/users/cdcarter","html_url":"https://github.com/cdcarter","followers_url":"https://api.github.com/users/cdcarter/followers","following_url":"https://api.github.com/users/cdcarter/following{/other_user}","gists_url":"https://api.github.com/users/cdcarter/gists{/gist_id}","starred_url":"https://api.github.com/users/cdcarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdcarter/subscriptions","organizations_url":"https://api.github.com/users/cdcarter/orgs","repos_url":"https://api.github.com/users/cdcarter/repos","events_url":"https://api.github.com/users/cdcarter/events{/privacy}","received_events_url":"https://api.github.com/users/cdcarter/received_events","type":"User","site_admin":false},"repo":{"id":34878821,"name":"Volunteers-for-Salesforce","full_name":"cdcarter/Volunteers-for-Salesforce","owner":{"login":"cdcarter","id":164,"avatar_url":"https://avatars.githubusercontent.com/u/164?v=3","gravatar_id":"","url":"https://api.github.com/users/cdcarter","html_url":"https://github.com/cdcarter","followers_url":"https://api.github.com/users/cdcarter/followers","following_url":"https://api.github.com/users/cdcarter/following{/other_user}","gists_url":"https://api.github.com/users/cdcarter/gists{/gist_id}","starred_url":"https://api.github.com/users/cdcarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdcarter/subscriptions","organizations_url":"https://api.github.com/users/cdcarter/orgs","repos_url":"https://api.github.com/users/cdcarter/repos","events_url":"https://api.github.com/users/cdcarter/events{/privacy}","received_events_url":"https://api.github.com/users/cdcarter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cdcarter/Volunteers-for-Salesforce","description":"DJH Consulting's Volunteers for Salesforce managed package","fork":true,"url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce","forks_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/forks","keys_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/teams","hooks_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/hooks","issue_events_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/issues/events{/number}","events_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/events","assignees_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/assignees{/user}","branches_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/branches{/branch}","tags_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/tags","blobs_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/git/refs{/sha}","trees_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/statuses/{sha}","languages_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/languages","stargazers_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/stargazers","contributors_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/contributors","subscribers_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/subscribers","subscription_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/subscription","commits_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/commits{/sha}","git_commits_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/git/commits{/sha}","comments_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/comments{/number}","issue_comment_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/issues/comments{/number}","contents_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/contents/{+path}","compare_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/merges","archive_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/downloads","issues_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/issues{/number}","pulls_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/pulls{/number}","milestones_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/milestones{/number}","notifications_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/labels{/name}","releases_url":"https://api.github.com/repos/cdcarter/Volunteers-for-Salesforce/releases{/id}","created_at":"2015-04-30T21:58:45Z","updated_at":"2015-05-01T20:09:40Z","pushed_at":"2015-05-01T22:18:50Z","git_url":"git://github.com/cdcarter/Volunteers-for-Salesforce.git","ssh_url":"git@github.com:cdcarter/Volunteers-for-Salesforce.git","clone_url":"https://github.com/cdcarter/Volunteers-for-Salesforce.git","svn_url":"https://github.com/cdcarter/Volunteers-for-Salesforce","homepage":"","size":1447,"stargazers_count":0,"watchers_count":0,"language":"Apex","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"davidhabib:master","ref":"master","sha":"3e6c4aea5300121355f5e45fb8f9a4b3ecb9e307","user":{"login":"davidhabib","id":908119,"avatar_url":"https://avatars.githubusercontent.com/u/908119?v=3","gravatar_id":"","url":"https://api.github.com/users/davidhabib","html_url":"https://github.com/davidhabib","followers_url":"https://api.github.com/users/davidhabib/followers","following_url":"https://api.github.com/users/davidhabib/following{/other_user}","gists_url":"https://api.github.com/users/davidhabib/gists{/gist_id}","starred_url":"https://api.github.com/users/davidhabib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidhabib/subscriptions","organizations_url":"https://api.github.com/users/davidhabib/orgs","repos_url":"https://api.github.com/users/davidhabib/repos","events_url":"https://api.github.com/users/davidhabib/events{/privacy}","received_events_url":"https://api.github.com/users/davidhabib/received_events","type":"User","site_admin":false},"repo":{"id":2840103,"name":"Volunteers-for-Salesforce","full_name":"davidhabib/Volunteers-for-Salesforce","owner":{"login":"davidhabib","id":908119,"avatar_url":"https://avatars.githubusercontent.com/u/908119?v=3","gravatar_id":"","url":"https://api.github.com/users/davidhabib","html_url":"https://github.com/davidhabib","followers_url":"https://api.github.com/users/davidhabib/followers","following_url":"https://api.github.com/users/davidhabib/following{/other_user}","gists_url":"https://api.github.com/users/davidhabib/gists{/gist_id}","starred_url":"https://api.github.com/users/davidhabib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidhabib/subscriptions","organizations_url":"https://api.github.com/users/davidhabib/orgs","repos_url":"https://api.github.com/users/davidhabib/repos","events_url":"https://api.github.com/users/davidhabib/events{/privacy}","received_events_url":"https://api.github.com/users/davidhabib/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidhabib/Volunteers-for-Salesforce","description":"DJH Consulting's Volunteers for Salesforce managed package","fork":false,"url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce","forks_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/forks","keys_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/teams","hooks_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/hooks","issue_events_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/issues/events{/number}","events_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/events","assignees_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/assignees{/user}","branches_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/branches{/branch}","tags_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/tags","blobs_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/statuses/{sha}","languages_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/languages","stargazers_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/stargazers","contributors_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/contributors","subscribers_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/subscribers","subscription_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/subscription","commits_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/contents/{+path}","compare_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/merges","archive_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/downloads","issues_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/issues{/number}","pulls_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls{/number}","milestones_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/milestones{/number}","notifications_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/labels{/name}","releases_url":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/releases{/id}","created_at":"2011-11-24T00:24:17Z","updated_at":"2015-05-04T03:54:06Z","pushed_at":"2015-05-04T03:54:06Z","git_url":"git://github.com/davidhabib/Volunteers-for-Salesforce.git","ssh_url":"git@github.com:davidhabib/Volunteers-for-Salesforce.git","clone_url":"https://github.com/davidhabib/Volunteers-for-Salesforce.git","svn_url":"https://github.com/davidhabib/Volunteers-for-Salesforce","homepage":"","size":2039,"stargazers_count":22,"watchers_count":22,"language":"Apex","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":51,"forks":27,"open_issues":51,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/144"},"html":{"href":"https://github.com/davidhabib/Volunteers-for-Salesforce/pull/144"},"issue":{"href":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/issues/144"},"comments":{"href":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/issues/144/comments"},"review_comments":{"href":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/144/comments"},"review_comment":{"href":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/pulls/144/commits"},"statuses":{"href":"https://api.github.com/repos/davidhabib/Volunteers-for-Salesforce/statuses/482959df9e49200773ed326a73bbfc5b6ea00a23"}}}}