(function () {
    "use strict";

    kintone.events.on(["app.record.create.show","app.record.edit.show"], function(event) {
      var record = event.record;
      record.担任1.value = record.担当1.value.map(function(user) {return user.name}).join(",");
      record.担任2.value = record.担当2.value.map(function(user) {return user.name}).join(",");
      record.担任3.value = record.担当3.value.map(function(user) {return user.name}).join(",");
      return event;
    });

    kintone.events.on(["app.record.create.change.担当1","app.record.edit.change.担当1"], function(event) {
      var record = event.record;
      record.担任1.value = record.担当1.value.map(function(user) {return user.name}).join(",");
      return event;
    });

    kintone.events.on(["app.record.create.change.担当2","app.record.edit.change.担当2"], function(event) {
      var record = event.record;
      record.担任2.value = record.担当2.value.map(function(user) {return user.name}).join(",");
      return event;
    });

    kintone.events.on(["app.record.create.change.担当3","app.record.edit.change.担当3"], function(event) {
      var record = event.record;
      record.担任3.value = record.担当3.value.map(function(user) {return user.name}).join(",");
      return event;
    });

})();