最近の検索
最近の検索はありません

Jose Smith
参加日2021年10月16日
·
前回のアクティビティ2021年10月16日
フォロー中
0
フォロワー
0
合計アクティビティ
2
投票
0
サブスクリプション
1
アクティビティの概要
バッジ
記事
投稿
コミュニティへのコメント
記事へのコメント
アクティビティの概要
さんの最近のアクティビティ Jose Smith
Jose Smithさんが投稿を作成しました:
投稿 Developer - Zendesk Apps Framework (ZAF)
Hi,
In modal.html, create a button. In the first function getData(), I can retrieve the sunshine object ID dynamically. Is there a way to also retrieve the ticket.requester.id and the sunshine.object.id in the buttonOrder() function? I bold these two variables in the function.
Any guidance is appreciate, thanks!
var client = ZAFClient.init();
client.on('app.registered', init);
function init(){
var hashes = window.location.hash;
var param = hashes.split('&');
id = param[0].replace('#','');
requester_id = param[1];
getData();
};
//Function - Get data from custom objects
function getData(){
//Get object's attributes
var objectSettings = {"url": "/api/sunshine/objects/records/" + id};
client.request(objectSettings).then(function(response){
//Loop through object's attributes and create list (see function below)
createAttributeList(response);
//Get events related to current object, loop through and create list (see function below)
createEventList(response);
}).catch(function(error){
//Display error message (see function below)
showCoError(error);
});
function buttonOrder() {
let options = {
url: 'https://d3v-test.zendesk.com/api/v2/users/'+ ticket.requester.id + '.json',
type: 'PUT',
dataType: 'json',
contentType: 'application/json',
cors: true,
data: JSON.stringify({
"user": {"order_id": sunshine.object.id}
})
};
投稿日時:2021年10月14日 · Jose Smith
2
フォロワー
3
投票
1
コメント