Last active
June 6, 2023 05:08
-
-
Save hatappo/0510a904f17e3490119a89d2a1ccd358 to your computer and use it in GitHub Desktop.
Kintone のアプリのデータを Zendesk のリクエスト・フォームに転送する Kintone カスタム JS のサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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