{"action":"created","comment":{"url":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/comments/115230553","pull_request_review_id":36752205,"id":115230553,"diff_hunk":"@@ -0,0 +1,161 @@\n+package services;\n+\n+import com.fasterxml.jackson.databind.JsonNode;\n+import models.JiraAuth;\n+import models.ResponseToClient;\n+import play.libs.Json;\n+import play.libs.ws.WSAuthScheme;\n+import play.libs.ws.WSClient;\n+import play.libs.ws.WSRequest;\n+import play.libs.ws.WSResponse;\n+import utils.ConfigUtilities;\n+\n+import java.util.concurrent.CompletionStage;\n+\n+/**\n+ * The class is for all \"reading actions\" on JIRA.\n+ * Extracting fields from raw response on need.\n+ */\n+public class JiraReaderService {\n+  private String messageToReturn;\n+  private WSClient ws;\n+  private JiraAuth jiraAuth;\n+\n+\n+  public JiraReaderService(WSClient ws, JiraAuth jiraAuth) {\n+    this.ws = ws;\n+    this.jiraAuth = jiraAuth;\n+  }\n+\n+  /**\n+   * To request for JIRA ticket info page via REST API. A non-blocking call.\n+   *\n+   * @param ticketId ticket ID in string.\n+   * @return info page encoded in JSON.\n+   */\n+  public CompletionStage<JsonNode> fetchTicketByApi(String ticketId) {\n+\n+    WSRequest request = ws.url(ConfigUtilities.getString(\"jira.baseUrl\")\n+      + ConfigUtilities.getString(\"jira.issueEndpoint\")\n+      + ticketId);\n+    WSRequest complexRequest = request.setAuth(jiraAuth.username, jiraAuth.password, WSAuthScheme.BASIC);\n+\n+    return complexRequest.get().thenApply(WSResponse::asJson);\n+  }\n+\n+  /**\n+   * A facade to determine what ticket info to readTicketInfo. Then call\n+   * related methods below.\n+   *\n+   * @param response","path":"server/app/services/JiraReaderService.java","position":50,"original_position":50,"commit_id":"3ae02b85b89595a95cfc6b4e81981d0befbb5ba5","original_commit_id":"3ae02b85b89595a95cfc6b4e81981d0befbb5ba5","user":{"login":"dongxuDX","id":16287080,"avatar_url":"https://avatars2.githubusercontent.com/u/16287080?v=3","gravatar_id":"","url":"https://api.github.com/users/dongxuDX","html_url":"https://github.com/dongxuDX","followers_url":"https://api.github.com/users/dongxuDX/followers","following_url":"https://api.github.com/users/dongxuDX/following{/other_user}","gists_url":"https://api.github.com/users/dongxuDX/gists{/gist_id}","starred_url":"https://api.github.com/users/dongxuDX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongxuDX/subscriptions","organizations_url":"https://api.github.com/users/dongxuDX/orgs","repos_url":"https://api.github.com/users/dongxuDX/repos","events_url":"https://api.github.com/users/dongxuDX/events{/privacy}","received_events_url":"https://api.github.com/users/dongxuDX/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2017-05-08T11:55:18Z","updated_at":"2017-05-08T11:55:18Z","html_url":"https://github.com/agiledigital/poet-slack-bot/pull/26#discussion_r115230553","pull_request_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/comments/115230553"},"html":{"href":"https://github.com/agiledigital/poet-slack-bot/pull/26#discussion_r115230553"},"pull_request":{"href":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/26","id":117196388,"html_url":"https://github.com/agiledigital/poet-slack-bot/pull/26","diff_url":"https://github.com/agiledigital/poet-slack-bot/pull/26.diff","patch_url":"https://github.com/agiledigital/poet-slack-bot/pull/26.patch","issue_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/issues/26","number":26,"state":"open","locked":false,"title":"Feature/restructure code","user":{"login":"sabiipoks","id":13197772,"avatar_url":"https://avatars3.githubusercontent.com/u/13197772?v=3","gravatar_id":"","url":"https://api.github.com/users/sabiipoks","html_url":"https://github.com/sabiipoks","followers_url":"https://api.github.com/users/sabiipoks/followers","following_url":"https://api.github.com/users/sabiipoks/following{/other_user}","gists_url":"https://api.github.com/users/sabiipoks/gists{/gist_id}","starred_url":"https://api.github.com/users/sabiipoks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sabiipoks/subscriptions","organizations_url":"https://api.github.com/users/sabiipoks/orgs","repos_url":"https://api.github.com/users/sabiipoks/repos","events_url":"https://api.github.com/users/sabiipoks/events{/privacy}","received_events_url":"https://api.github.com/users/sabiipoks/received_events","type":"User","site_admin":false},"body":"Integrate LUIS into the code for NLP.","created_at":"2017-04-24T06:29:17Z","updated_at":"2017-05-08T11:55:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62c23a01f6b324e091f7d2f62a225f7a3e045b51","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/26/commits","review_comments_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/26/comments","review_comment_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/issues/26/comments","statuses_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/statuses/3ae02b85b89595a95cfc6b4e81981d0befbb5ba5","head":{"label":"agiledigital:feature/restructure-code","ref":"feature/restructure-code","sha":"3ae02b85b89595a95cfc6b4e81981d0befbb5ba5","user":{"login":"agiledigital","id":5221537,"avatar_url":"https://avatars2.githubusercontent.com/u/5221537?v=3","gravatar_id":"","url":"https://api.github.com/users/agiledigital","html_url":"https://github.com/agiledigital","followers_url":"https://api.github.com/users/agiledigital/followers","following_url":"https://api.github.com/users/agiledigital/following{/other_user}","gists_url":"https://api.github.com/users/agiledigital/gists{/gist_id}","starred_url":"https://api.github.com/users/agiledigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agiledigital/subscriptions","organizations_url":"https://api.github.com/users/agiledigital/orgs","repos_url":"https://api.github.com/users/agiledigital/repos","events_url":"https://api.github.com/users/agiledigital/events{/privacy}","received_events_url":"https://api.github.com/users/agiledigital/received_events","type":"Organization","site_admin":false},"repo":{"id":65251021,"name":"poet-slack-bot","full_name":"agiledigital/poet-slack-bot","owner":{"login":"agiledigital","id":5221537,"avatar_url":"https://avatars2.githubusercontent.com/u/5221537?v=3","gravatar_id":"","url":"https://api.github.com/users/agiledigital","html_url":"https://github.com/agiledigital","followers_url":"https://api.github.com/users/agiledigital/followers","following_url":"https://api.github.com/users/agiledigital/following{/other_user}","gists_url":"https://api.github.com/users/agiledigital/gists{/gist_id}","starred_url":"https://api.github.com/users/agiledigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agiledigital/subscriptions","organizations_url":"https://api.github.com/users/agiledigital/orgs","repos_url":"https://api.github.com/users/agiledigital/repos","events_url":"https://api.github.com/users/agiledigital/events{/privacy}","received_events_url":"https://api.github.com/users/agiledigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/agiledigital/poet-slack-bot","description":"Project Oriented Enlightenment Tool (POET) bringing intelligent JIRA interaction to your Slack channel.","fork":false,"url":"https://api.github.com/repos/agiledigital/poet-slack-bot","forks_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/forks","keys_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/teams","hooks_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/hooks","issue_events_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/issues/events{/number}","events_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/events","assignees_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/assignees{/user}","branches_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/branches{/branch}","tags_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/tags","blobs_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/languages","stargazers_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/stargazers","contributors_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/contributors","subscribers_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/subscribers","subscription_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/subscription","commits_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/contents/{+path}","compare_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/merges","archive_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/downloads","issues_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/issues{/number}","pulls_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/labels{/name}","releases_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/releases{/id}","deployments_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/deployments","created_at":"2016-08-09T01:05:20Z","updated_at":"2017-04-30T03:42:31Z","pushed_at":"2017-05-03T13:04:46Z","git_url":"git://github.com/agiledigital/poet-slack-bot.git","ssh_url":"git@github.com:agiledigital/poet-slack-bot.git","clone_url":"https://github.com/agiledigital/poet-slack-bot.git","svn_url":"https://github.com/agiledigital/poet-slack-bot","homepage":"","size":1233,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":3,"default_branch":"master"}},"base":{"label":"agiledigital:master","ref":"master","sha":"b6fd53f241a9351ccc05f015092f2a6ad9abbb0e","user":{"login":"agiledigital","id":5221537,"avatar_url":"https://avatars2.githubusercontent.com/u/5221537?v=3","gravatar_id":"","url":"https://api.github.com/users/agiledigital","html_url":"https://github.com/agiledigital","followers_url":"https://api.github.com/users/agiledigital/followers","following_url":"https://api.github.com/users/agiledigital/following{/other_user}","gists_url":"https://api.github.com/users/agiledigital/gists{/gist_id}","starred_url":"https://api.github.com/users/agiledigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agiledigital/subscriptions","organizations_url":"https://api.github.com/users/agiledigital/orgs","repos_url":"https://api.github.com/users/agiledigital/repos","events_url":"https://api.github.com/users/agiledigital/events{/privacy}","received_events_url":"https://api.github.com/users/agiledigital/received_events","type":"Organization","site_admin":false},"repo":{"id":65251021,"name":"poet-slack-bot","full_name":"agiledigital/poet-slack-bot","owner":{"login":"agiledigital","id":5221537,"avatar_url":"https://avatars2.githubusercontent.com/u/5221537?v=3","gravatar_id":"","url":"https://api.github.com/users/agiledigital","html_url":"https://github.com/agiledigital","followers_url":"https://api.github.com/users/agiledigital/followers","following_url":"https://api.github.com/users/agiledigital/following{/other_user}","gists_url":"https://api.github.com/users/agiledigital/gists{/gist_id}","starred_url":"https://api.github.com/users/agiledigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agiledigital/subscriptions","organizations_url":"https://api.github.com/users/agiledigital/orgs","repos_url":"https://api.github.com/users/agiledigital/repos","events_url":"https://api.github.com/users/agiledigital/events{/privacy}","received_events_url":"https://api.github.com/users/agiledigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/agiledigital/poet-slack-bot","description":"Project Oriented Enlightenment Tool (POET) bringing intelligent JIRA interaction to your Slack channel.","fork":false,"url":"https://api.github.com/repos/agiledigital/poet-slack-bot","forks_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/forks","keys_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/teams","hooks_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/hooks","issue_events_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/issues/events{/number}","events_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/events","assignees_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/assignees{/user}","branches_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/branches{/branch}","tags_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/tags","blobs_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/languages","stargazers_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/stargazers","contributors_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/contributors","subscribers_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/subscribers","subscription_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/subscription","commits_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/contents/{+path}","compare_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/merges","archive_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/downloads","issues_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/issues{/number}","pulls_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/labels{/name}","releases_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/releases{/id}","deployments_url":"https://api.github.com/repos/agiledigital/poet-slack-bot/deployments","created_at":"2016-08-09T01:05:20Z","updated_at":"2017-04-30T03:42:31Z","pushed_at":"2017-05-03T13:04:46Z","git_url":"git://github.com/agiledigital/poet-slack-bot.git","ssh_url":"git@github.com:agiledigital/poet-slack-bot.git","clone_url":"https://github.com/agiledigital/poet-slack-bot.git","svn_url":"https://github.com/agiledigital/poet-slack-bot","homepage":"","size":1233,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/26"},"html":{"href":"https://github.com/agiledigital/poet-slack-bot/pull/26"},"issue":{"href":"https://api.github.com/repos/agiledigital/poet-slack-bot/issues/26"},"comments":{"href":"https://api.github.com/repos/agiledigital/poet-slack-bot/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/agiledigital/poet-slack-bot/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/agiledigital/poet-slack-bot/statuses/3ae02b85b89595a95cfc6b4e81981d0befbb5ba5"}}}}
{"actor":{"display_login":"dongxuDX"}}