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 객체. 누구든지 스크립트에서 액세스 권한을 얻는 방법을 알고 있습니까?