0
私はWebhookリスナーと入力データを操作するためのスクリプトを使用する内部アプリを持っています。私はそれにこれを掲示しています:以下のようにスクリプトステップでWebhook入力を使用できませんか?
curl -X POST -d '{
"assignment_id": 12345,
"updated_custom_fields": [{
"name": "RNVIDAYEBB",
"value": "updated!"
},
{
"name": "QUFTXSIBYA",
"value": "and me too"
}
],
"custom_fields": [{
"id": 981,
"name": "RDEXDPVKRD",
"fields": [
{
"id": 4096,
"name": "RNVIDAYEBB",
"default": "EDJEAJICYW",
"required": true,
"value": "Blah"
},
{
"id": 4097,
"name": "QUFTXSIBYA",
"default": "",
"required": true,
"value": ""
}]
}]
}' "https://hooks.zapier.com/hooks/catch/......"
私のスクリプトは次のとおりです。
update_custom_fields_by_name_pre_write: function(bundle) {
var updatedFields = _.map(bundle.request.data.custom_fields, function(group) {
return _.map(group.fields, function(field) {
return _.extend(field, _.findWhere(bundle.request.data.updated_custom_fields, { name: field.name}));
});
});
bundle.request.data = updatedFields;
return bundle.request;
}
私はマージ・ロジックが良好であることを知っているが、それはcustom_fields
とupdated_custom_fields
配列が中に存在していないように見えますbundle.request.dataオブジェクト。誰でもスクリプトにアクセスする方法を知っていますか?