如果调用简单字符串,我有这个代码可以工作
$(document).ready( function() {
app.initialized()
.then(function(_client) {
var client = _client;
client.events.on('app.activated',
function() {
client.data.get('ticket')
.then(function(data) {
$('#issue_title').text("Issue:" + data.ticket.description);
})
.catch(function(e) {
console.log('Exception - ', e);
});
});
});
});
但是当我将它更改为数组对象时它不起作用
$(document).ready( function() {
app.initialized()
.then(function(_client) {
var client = _client;
client.events.on('app.activated',
function() {
client.data.get('ticket')
.then(function(data) {
$('#issue_title').text("Issue:" + data.ticket.attachments['name']);
})
.catch(function(e) {
console.log('Exception - ', e);
});
});
});
});
我正在使用这张票 ATTACHMENTS 有效载荷
Sample Payload
{
"ticket": {
"attachments": [],
"cc_emails": [],
"company_id": 1,
"created_at": "2017-04-12T06:05:56.000Z",
"custom_fields": [{
"custom_number": null,
"custom_line1": " "
}],
}