{"id":20015183,"url":"https://github.com/corytodd/jirachat","last_synced_at":"2025-08-30T05:07:15.515Z","repository":{"id":25833476,"uuid":"29272877","full_name":"corytodd/jirachat","owner":"corytodd","description":"JIRA Webhook handler that forwards to Hipchat and Slack","archived":false,"fork":false,"pushed_at":"2018-04-28T02:15:39.000Z","size":45,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-13T19:41:33.421Z","etag":null,"topics":["gae","golang","hipchat","slack"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/corytodd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-15T00:27:42.000Z","updated_at":"2022-05-10T12:46:01.000Z","dependencies_parsed_at":"2022-08-06T07:15:19.476Z","dependency_job_id":null,"html_url":"https://github.com/corytodd/jirachat","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/corytodd/jirachat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corytodd%2Fjirachat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corytodd%2Fjirachat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corytodd%2Fjirachat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corytodd%2Fjirachat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corytodd","download_url":"https://codeload.github.com/corytodd/jirachat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corytodd%2Fjirachat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272805572,"owners_count":24995916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gae","golang","hipchat","slack"],"created_at":"2024-11-13T07:45:17.508Z","updated_at":"2025-08-30T05:07:15.495Z","avatar_url":"https://github.com/corytodd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jirachat\nGolang JIRA Webhook handler that forwards to Hipchat and/or Slack\n\n\nThis work is mostly adapted from https://github.com/tbruyelle/hipchat-go for the Hipchat portions\n\nThe Slack integration is adapted from https://github.com/daikikohara/enotify-slack\n\n\nThere are a ton of things that could be done to improve this so feel free to contribute.\n\nIf you are using this and I break something, feel free to yell :). \n\nHow to work with the Slack service\n```\n// Slack Sample Handler\nfunc SendSlack(w http.ResponseWriter, r *http.Request) {\n\tc := appengine.NewContext(r)\n\n\tsvc := jirachat.NewSlackService(r,\n\t\t\u0026jirachat.SlackConfig{\n\t\t\tErrChan:    \u003cYOU_ERROR_CHANNEL\u003e,\n\t\t\tBotName:    \u003cBOT_NAME\u003e,\n\t\t\tWebhookUrl: \u003cSLACK_WEBHOOK_URL\u003e,\n\t\t})\n\n\t// Parse our event, baby! JIRA event can be touchy,\n\t// don't consider parse errors fatal\n\tevent, err := jirachat.Parse(r)\n\tif err != nil {\n\t\tc.Errorf(\"Error parsing JIRA event %v\", err)\n\t\t//w.WriteHeader(http.StatusInternalServerError)\n\t\t//return\n\t}\n\n\tmySvc := \u0026MySlacker{config: svc.Config}\n\terr = mySvc.IssueCreated(\u0026event)\n\n\tif err != nil {\n\t\tc.Errorf(\"Slack Error %v\", err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// All went well!\n\tw.WriteHeader(http.StatusOK)\n}\n\ntype MySlacker struct {\n\tconfig *jirachat.SlackConfig\n}\n\nfunc (s *MySlacker) IssueCreated(event *jirachat.JIRAWebevent) error {\n\tpayload := jirachat.SlackMessage{}\n\tfields := []jirachat.Field{\n\t\tjirachat.Field{\n\t\t\tTitle: \"Summary\",\n\t\t\tValue: event.Issue.Fields.Summary,\n\t\t\tShort: false,\n\t\t},\n\t}\n\ttitle := fmt.Sprintf(\"%s created %s\", event.GetUserLink(s.config),\n\t\tevent.GetIssueLink(s.config))\n\tattachment := jirachat.Attachment{\n\t\tFallback: title,\n\t\tPretext:  title,\n\t\tColor:    getPriorityColor(event.Issue.Fields.Priority.Id),\n\t\tFields:   fields,\n\t}\n\n\tpayload.Channel = s.config.Channel\n\tpayload.Username = s.config.BotName\n\tpayload.Icon_url = event.User.LargeAvatar()\n\tpayload.Unfurl_links = true\n\tpayload.Text = \"\"\n\tpayload.Attachments = []jirachat.Attachment{attachment}\n\treturn payload.SendEvent(s.config)\n}\nfunc getPriorityColor(id string) string {\n\n\tswitch {\n\tcase id == \"1\": \t\t// Blocker\n\t\treturn \"#990000\"\n\tcase id == \"2\":\n\t\treturn \"#cc0000\" \t// Critical\n\tcase id == \"3\":\n\t\treturn \"#ff0000\"\n\tcase id == \"6\": \t\t// Normal\n\t\treturn \"#339933\"\n\tcase id == \"4\": \t\t// Minor\n\t\treturn \"#006600\"\n\tcase id == \"5\": \t\t// Trivial\n\t\treturn \"#003300\"\n\tcase id == \"10000\": \t// Holding\n\t\treturn \"#000000\"\n\tdefault:\n\t\treturn jriachat.ColorGood\n\t}\n}\n\n```\n\nHow to work with the Hipchat service\n```\n// Sample Hipchat Handler\nfunc SendHipchat(w http.ResponseWriter, r *http.Request) {\n\tc := appengine.NewContext(r)\n\n\tclient, err := jirachat.NewHipService(r,\n\t\t\u0026jirachat.HipConfig{Token: \u003cYOUR_API_TOKEN\u003e})\n\n\tif err != nil {\n\t\tc.Errorf(\"Failed to create HipService: %v\", err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tvar req jirachat.NotificationRequest\n\tvar sendIt bool\n\n\t// Parse our event, baby! JIRA event can be touchy,\n\t// don't consider parse errors fatal\n\tevent, err := jirachat.Parse(r)\n\tif err != nil {\n\t\tc.Errorf(\"Error parsing JIRA event %v\", err)\n\t\t//w.WriteHeader(http.StatusInternalServerError)\n\t\t//return\n\t}\n\n\tswitch event.WebhookEvent {\n\tcase \"jira:issue_created\":\n\t\treq = jirachat.NotificationRequest{\n\t\t\tMessage: getUserAvatar(event.User) + \" \" +\n\t\t\t\tgetUserLink(event.User) +\n\t\t\t\t\"\u003ci\u003e\u003cstrong\u003e created \u003c/i\u003e \u0026#8594\u003c/strong\u003e \" +\n\t\t\t\tgetLink(event.Issue),\n\t\t\tColor:         jirachat.ColorGreen,\n\t\t\tMessageFormat: jirachat.FormatHTML,\n\t\t\tNotify:        true,\n\t\t}\n\t}\n\tsendIt = true\n\tif sendIt {\n\t\tif resp, err := client.Notification(\u003cROOM_ID\u003e, \u0026req); err != nil {\n\t\t\tc.Errorf(err.Error())\n\t\t\tfmt.Printf(\"Error during room notification %q\\n\", err)\n\t\t\tfmt.Printf(\"Server returns %+v\\n\", resp)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\t// Everything went well!\n\t\tw.WriteHeader(http.StatusOK)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorytodd%2Fjirachat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorytodd%2Fjirachat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorytodd%2Fjirachat/lists"}