Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GASでBacklogの情報をSlack通知 できるようにしてみた

Takayuki
August 05, 2018

GASでBacklogの情報をSlack通知 できるようにしてみた

GASでBacklogの情報をSlack通知 できるようにしてみた

Takayuki

August 05, 2018
Tweet

More Decks by Takayuki

Other Decks in Technology

Transcript

  1. Copyright Re:Build.inc All Rights Reserved.
    ("4Ɗ#BDLMPHƑ౦ḸƵ
    4MBDL๙ᆩƊŰƮƫũƎźƉƢƂ
    鈴木孝之
    2018/08/03
    3F#VJME

    View full-size slide

  2. Copyright Re:Build.inc All Rights Reserved.
    "HFOEB
    ձࣾɾࣗݾ঺հ
    ΍Γ͍ͨ͜ͱ
    ಋೖํ๏

    View full-size slide

  3. Copyright Re:Build.inc All Rights Reserved.
    ձࣾɾࣗݾ঺հ

    View full-size slide

  4. Copyright Re:Build.inc All Rights Reserved.
    1.ࣗݾ঺հ
    ◆໊લ
    ླ໦ ޹೭(Suzuki Takayuki)
    ◆ࣗݾ঺հ
    ɾ1990೥ɺਆಸ઒ݝੜ·Εɻ
    ɾࣾձਓʹͳ͔ͬͯΒɺϓϩάϥϛϯάΛ࢝ΊΔɻ
    ɾ2015೥ʹϑϧεϐʔυʹೖࣾ͠ɺ2017೥ʹ
    ϑϦʔϥϯεΛ΍ͬͨޙʹ2017೥11݄ʹԭೄͰىۀɻ
    ◆झຯ
    ίεϓϨɺԻָϥΠϒɺϚϥιϯେձʹग़Δɺ໺ٿ؍ઓ
    ◆εΩϧ
    ɾPHP,
    Symfony2,CakePHP3,Laravel5,
    ɾJavaScript,
    backbone.js,Angular4,Vue.js

    View full-size slide

  5. Copyright Re:Build.inc All Rights Reserved.
    1.ձࣾ঺հ
    ◆ձ໊ࣾ
    גࣜձࣾRe:Build
    ◆ॅॴ
    ԭೄݝԭೄࢢதԝ̍ஸ໨̍̒−̕
    ◆ࣄۀ಺༰
    ɾ೶ۀʹ͓͍ͯͷϑʔυϩεΛແ͘͢
    ࣗࣾWEBαʔϏεͷاըɾ։ൃɻ
    ɾडୗ։ൃ
    ◆ࣾһ
    4໊
    ◆ΤϯδχΞͷಇ͖ํ
    ϦϞʔτϫʔΫՄೳͳࣗ༝ͳಇ͖ํΛਪ঑ͯ͠·͢ʂ

    View full-size slide

  6. ɾαʔϏε໊
    temite
    ɾγεςϜ֓ཁ
    ECϓϥοτϑΥʔϜ
    ΫϨδοτܾࡁ
    ΞϑΟϦΤΠτ
    ͳͲ
    ɾ࢖͍ͬͯΔٕज़
    ݴޠ : PHP,JavaScript
    ϑϨʔϜϫʔΫ: laravel5,Vue.js,JQueryͳͲ
    ։ൃதͷαʔϏε

    View full-size slide

  7. Copyright Re:Build.inc All Rights Reserved.
    ΍Γ͍ͨ͜ͱ

    View full-size slide

  8. ࢓ࣄͰ͸༷ʑͳ֎෦αʔϏε(gitͳͲ)ͷ৘ใΛ
    SlackͰҰݩ؅ཧ͓ͯ͠Γɺ Backlogͷ৘ใ΋
    SlackͰҰݩ؅ཧ͔ͨͬͨ͠ɻ
    എܠ

    View full-size slide

  9. ɾ࢒λεΫͷSlack௨஌
    ɾΞΫςΟϏςΟͷSlack௨஌
    ɾ࢒λεΫΛεϓϨουγʔτʹॻ͖ࠐΈ
    ΍Γ͍ͨ͜ͱ

    View full-size slide

  10. શମߏ੒
    ՝୊ͳͲΛ௥Ճૢ࡞ WebhookͰ࣮ߦ
    Slack௨஌
    Backlog API
    Λୟ͘
    εϓϨοτγʔτ
    ॻ͖ࠐΈ

    View full-size slide

  11. Slack௨஌Πϝʔδ

    View full-size slide

  12. γʔτॻ͖ࠐΈΠϝʔδ

    View full-size slide

  13. WWW.SITE2MAX.PRO
    Free PowerPoint & KeyNote Templates
    DEMO
    DEMO

    View full-size slide

  14. Copyright Re:Build.inc All Rights Reserved.
    ಋೖํ๏

    View full-size slide

  15. APIΩʔ͸ͦΕͧΕͷϦϑΝϨϯεΛࢀߟʹऔಘ͠·͢ɻ
    ɾGASͷιʔε
    ɾBacklogͷAPIΩʔ
    ɾSlackͷWebhookURL
    ɾBacklogͷϓϩδΣΫτͷID
    ४උ͢Δ΋ͷ

    View full-size slide

  16. Google Apps Scriptʢ௨শGASʣ͸ɺGoogle͕ఏڙ͢Δ
    11ͷαʔϏεΛΫϥ΢υ্ͰεΫϦϓτΛ࣮ߦ͢Δ͜ͱ
    Ͱૢ࡞Ͱ͖ΔαʔϏεͰ͢ɻεΫϦϓτͷݴޠ͸ɺ
    JavaScriptΛϕʔεͱ͍ͯ͠·͢ɻ
    ʮExcelͷϚΫϩͱಉ͡ʯͱݴΘΕΔ͜ͱ΋͋Γ·͢
    ͕ɺ͜Ε͸ਖ਼͋͘͠Γ·ͤΜɻεϓϨουγʔτ͚ͩΛ
    ૢ࡞͢Δ৔߹͸ɺExcelͷϚΫϩͱࣅ͍ͯ·͕͢ɺ
    Google Apps Script͸ΑΓ෯޿͍༻్ʹ࢖༻Ͱ͖·͢ɻ
    Google Apps Scriptͱ͸

    View full-size slide

  17. Backlog API
    Backlog API ͰԿ͕ग़དྷ·͔͢ʁ
    ՝୊,Wiki,ϑΝΠϧͷ௥Ճ΍औಘΛ࢝Ίɺϓϩ
    δΣΫτ΍Ϣʔβʔͷ؅ཧͳͲϒϥ΢β্ͷ
    BacklogͰͰ͖Δૢ࡞ͷେ෦෼ΛAPI͔Βߦ͏͜
    ͱ͕Ͱ͖·͢ɻৄ͘͠͸API ϦετΛࢀরͯ͠
    ͍ͩ͘͞ɻ ·ͨɺCross Origin Resource
    Sharing (CORS) ʹΑΔϒϥ΢β্ͰͷAjaxΛ
    ࢖༻ͨ͠ΫϩευϝΠϯ௨৴͕ՄೳͰ͢ɻ

    View full-size slide

  18. Backlog APIΩʔͷൃߦ

    View full-size slide

  19. Backlog APIΩʔͷൃߦ

    View full-size slide

  20. Webhook
    Webhook ͸ɺ՝୊΍ίϝϯτɺWikiɺϑΝΠϧͷ௥Ճ΍ߋ৽ɺSubversion
    ΍ Git ΁ͷίϛοτ΍ϓογϡͳͲͷΠϕϯτ͕ى͖ͨͱ͖ʹɺࢦఆͨ͠
    URLʹͦͷ৘ใΛૹ৴ (HTTPϦΫΤετ)͢Δ͜ͱ͕Ͱ͖ΔػೳͰ͢ɻ
    ྫ͑͹ɺ՝୊͕ߋ৽͞Εͨͱ͖ʹνϟοταʔϏεʹ௨஌ͨ͠ΓɺGit Ϧϙ
    δτϦʹϓογϡ͞Εͨͱ͖ʹϏϧυγεςϜʹ௨஌͢Δ౳ɺଞͷαʔϏ
    ε΍γεςϜͱͷ࿈ܞʹར༻͢Δ͜ͱ͕Ͱ͖·͢ɻ

    View full-size slide

  21. Backlog Webhookͷઃఆ

    View full-size slide

  22. Backlog Webhookͷઃఆ

    View full-size slide

  23. Slack Webhook URLऔಘ
    ҎԼURLʹΞΫηε͢Δɻ
    https://slack.com/services/new/incoming-webhook

    View full-size slide

  24. Slack Webhook URLऔಘ

    View full-size slide

  25. Slack Webhook URLऔಘ
    URLΛίϐʔ

    View full-size slide

  26. ҎԼͷ11ͷαʔϏεΛૢ࡞͢Δ͜ͱ͕Ͱ͖·͢ɻ
    ɾΧϨϯμʔ
    ɾίϯλΫτ
    ɾυϥΠϒ
    ɾυΩϡϝϯτ
    ɾεϓϨουγʔτ
    ɾϑΥʔϜ
    ɾGmail
    ɾάϧʔϓ
    ɾϚοϓ
    ɾαΠτ
    ɾLanguages
    Google Apps Scriptͷର৅ͱͳΔαʔϏε

    View full-size slide

  27. εϓϨουγʔτΛ৽ن࡞੒ > πʔϧɹ> εΫϦϓτΤσΟλ
    ΦϯϥΠϯΤσΟλ͕։͔ΕɺJavaScriptΛॻ͍͍͖ͯ·͢ɻ
    GASͷ࡞੒ํ๏

    View full-size slide

  28. GASͷιʔε
    ɾ࢒λεΫͷSlack௨஌
    ɾΞΫςΟϏςΟͷSlack
    ௨஌
    ɾ࢒λεΫΛεϓϨου
    γʔτʹॻ͖ࠐΈ
    ͳͲΛߦ͏

    View full-size slide

  29. Copyright Re:Build.inc All Rights Reserved.
    ·ͱΊ

    View full-size slide

  30. Backlog APIͱGASΛ
    ࢖͑͹΋ͬͱɺ
    ͍ΖΜͳࣄ͕Ͱ͖ͦ͏ʂʂʂ

    View full-size slide

  31. ࢀߟ
    https://qiita.com/murase/items/9175fb908492279ad817
    https://qiita.com/kingpanda/items/44667f2ddc39e760ea8b
    https://qiita.com/vmmhypervisor/items/18c99624a84df8b31008

    View full-size slide