Skip to content

Instantly share code, notes, and snippets.

@hatappo
Last active June 6, 2023 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatappo/0510a904f17e3490119a89d2a1ccd358 to your computer and use it in GitHub Desktop.
Save hatappo/0510a904f17e3490119a89d2a1ccd358 to your computer and use it in GitHub Desktop.
Kintone のアプリのデータを Zendesk のリクエスト・フォームに転送する Kintone カスタム JS のサンプル
(function () {
'use strict';
kintone.events.on(["app.record.detail.show"], event => {
const span = document.createElement('span');
const title = kintone.app.record.getFieldElement('title');
const body = kintone.app.record.getFieldElement('body');
const a = document.createElement('a');
const urlBase = 'https://*****/hc/ja/requests/new?ticket_form_id=*****';
const url = `${urlBase}&tf_subject=${encodeURI(title.innerText)}&tf_description=${encodeURI(body.innerText)}`;
a.setAttribute("href", url);
a.setAttribute("target", '_blank');
a.setAttribute("style", 'border-radius: 20px; border: 1px solid; padding: 5px; margin-right: 1em; ');
a.innerText = ' ***** に転送';
const buttonSpace = kintone.app.record.getSpaceElement('button_space');
buttonSpace.appendChild(a);
return event;
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment