LoginSignup
10
11

More than 3 years have passed since last update.

GASで定例ミーティングの議事録を自動生成する

Posted at

フォーマットの決まった定例mtgの議事録を毎回作るのが煩わしかったのでGoogle Apps Script(GAS)で簡易に自動化しました。
ソースコードコピペで動作しますので、同じような環境、悩みを持っている方の参考になれば幸いです。

前提条件

  • GSuiteを導入していること
  • 頻度の決まったMTGがあること(曜日固定など)
  • そのMTGのフォーマットが決まっていること

動作イメージ

こんな感じで動きます。

image.png

ソースコード

xxxxxxの部分を適切に変えるだけで動作します。

  • sourceId:Google DriveのファイルID。スプレッドシートの場合、https://docs.google.com/spreadsheets/d/この部分
  • webhookURL:SlackのwebhookURL

※ Slackに通知しない場合は //slackポスト用の...以下を削除します。
※ 曜日固定のmtgを想定しています。GASのトリガー設定で曜日を選択すると、mtgの翌日の曜日に議事録が自動生成されます。


// 来週分の議事録を生成(定例mtgが毎週同じ曜日にあることを想定している。)定例mtgの曜日が変わった場合は、マイトリガーから設定をする。
function makeMinute() {

  sourceId = "xxxxxx"; // 議事録テンプレートのID(Google Drive)

  // 来週のmtgの日付を取得、議事録のタイトルを生成
  var today = new Date();
  today.setDate(today.getDate() + 6); // 来週の日付に設定
  var year = today.getYear();
  var month = ("0" + (today.getMonth() + 1)).slice(-2);
  var day = ("0" + today.getDate()).slice(-2);
  targetName = "定例mtg_" + year + month + day;

  // 議事録マスタをコピーし、上で生成したタイトルに変更、その他共有設定をする。
  targetFile = DriveApp.getFileById(sourceId).makeCopy(targetName);
  targetFile.setSharing(DriveApp.Access.DOMAIN_WITH_LINK, DriveApp.Permission.EDIT)
  targetURL = targetFile.getUrl().replace('?usp=drivesdk', '');

  // slackポスト用のメッセージ、オプションの設定
  var body =
      {
        "attachments" : [
          {
            "fallback": "定例MTGの議事録を作ったよ!",
            "pretext": "定例MTGの議事録を作ったよ!来週までに記入よろしくね! \n" + targetURL,
          },
        ]
      };
  var webhookURL = "xxxxxx";
  var options = {
        'method' : 'POST',
        'contentType' : 'application/json',
        'payload' : JSON.stringify(body),
  };

  // slackへのポスト
  UrlFetchApp.fetch(webhookURL, options);
}

おわりに

こんな感じに動きます。
image.png

10
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
11