Skip to content

Commit

Permalink
Putting type ids into saved object array
Browse files Browse the repository at this point in the history
  • Loading branch information
ymao1 committed Jun 2, 2021
1 parent 67ed115 commit 3b8b3fa
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 276 deletions.
9 changes: 1 addition & 8 deletions x-pack/plugins/actions/server/lib/action_executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,12 @@ export class ActionExecutor {
const event: IEvent = {
event: { action: EVENT_LOG_ACTIONS.execute },
kibana: {
alerting: {
action_type_id: actionTypeId,
primary_saved_object: {
id: actionId,
type: 'action',
...namespace,
},
},
saved_objects: [
{
rel: SAVED_OBJECT_REL_PRIMARY,
type: 'action',
id: actionId,
type_id: actionTypeId,
...namespace,
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,18 @@ test('enqueues execution per selected action', async () => {
"action_group_id": "default",
"action_subgroup": undefined,
"instance_id": "2",
"primary_saved_object": Object {
"id": "1",
"type": "alert",
},
"rule_type_id": "test",
},
"saved_objects": Array [
Object {
"id": "1",
"rel": "primary",
"type": "alert",
"type_id": "test",
},
Object {
"id": "1",
"type": "action",
"type_id": "test",
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,19 @@ export function createExecutionHandler<
event: { action: EVENT_LOG_ACTIONS.executeAction },
kibana: {
alerting: {
instance_id: alertInstanceId,
action_group_id: actionGroup,
action_subgroup: actionSubgroup,
instance_id: alertInstanceId,
primary_saved_object: {
id: alertId,
},
saved_objects: [
{
rel: SAVED_OBJECT_REL_PRIMARY,
type: 'alert',
id: alertId,
type_id: alertType.id,
...namespace,
},
rule_type_id: alertType.id,
},
saved_objects: [
{ rel: SAVED_OBJECT_REL_PRIMARY, type: 'alert', id: alertId, ...namespace },
{ type: 'action', id: action.id, ...namespace },
{ type: 'action', id: action.id, type_id: action.actionTypeId, ...namespace },
],
},
};
Expand Down
Loading

0 comments on commit 3b8b3fa

Please sign in to comment.