diff --git a/x-pack/legacy/plugins/watcher/__jest__/client_integration/watch_create_threshold.test.tsx b/x-pack/legacy/plugins/watcher/__jest__/client_integration/watch_create_threshold.test.tsx
index f281408c9d439..fd73378dcaf08 100644
--- a/x-pack/legacy/plugins/watcher/__jest__/client_integration/watch_create_threshold.test.tsx
+++ b/x-pack/legacy/plugins/watcher/__jest__/client_integration/watch_create_threshold.test.tsx
@@ -296,9 +296,11 @@ describe.skip(' create route', () => {
triggerIntervalUnit: 'm',
aggType: 'count',
termSize: 5,
+ termOrder: 'desc',
thresholdComparator: '>',
timeWindowSize: 5,
timeWindowUnit: 'm',
+ hasTermsAgg: false,
threshold: 1000,
};
@@ -364,9 +366,11 @@ describe.skip(' create route', () => {
triggerIntervalUnit: 'm',
aggType: 'count',
termSize: 5,
+ termOrder: 'desc',
thresholdComparator: '>',
timeWindowSize: 5,
timeWindowUnit: 'm',
+ hasTermsAgg: false,
threshold: 1000,
};
@@ -428,9 +432,11 @@ describe.skip(' create route', () => {
triggerIntervalUnit: 'm',
aggType: 'count',
termSize: 5,
+ termOrder: 'desc',
thresholdComparator: '>',
timeWindowSize: 5,
timeWindowUnit: 'm',
+ hasTermsAgg: false,
threshold: 1000,
};
@@ -503,9 +509,11 @@ describe.skip(' create route', () => {
triggerIntervalUnit: 'm',
aggType: 'count',
termSize: 5,
+ termOrder: 'desc',
thresholdComparator: '>',
timeWindowSize: 5,
timeWindowUnit: 'm',
+ hasTermsAgg: false,
threshold: 1000,
};
@@ -594,9 +602,11 @@ describe.skip(' create route', () => {
triggerIntervalUnit: 'm',
aggType: 'count',
termSize: 5,
+ termOrder: 'desc',
thresholdComparator: '>',
timeWindowSize: 5,
timeWindowUnit: 'm',
+ hasTermsAgg: false,
threshold: 1000,
};
@@ -683,9 +693,11 @@ describe.skip(' create route', () => {
triggerIntervalUnit: 'm',
aggType: 'count',
termSize: 5,
+ termOrder: 'desc',
thresholdComparator: '>',
timeWindowSize: 5,
timeWindowUnit: 'm',
+ hasTermsAgg: false,
threshold: 1000,
};
@@ -752,9 +764,11 @@ describe.skip(' create route', () => {
triggerIntervalUnit: 'm',
aggType: 'count',
termSize: 5,
+ termOrder: 'desc',
thresholdComparator: '>',
timeWindowSize: 5,
timeWindowUnit: 'm',
+ hasTermsAgg: false,
threshold: 1000,
};
@@ -805,9 +819,11 @@ describe.skip(' create route', () => {
triggerIntervalUnit: 'm',
aggType: 'count',
termSize: 5,
+ termOrder: 'desc',
thresholdComparator: '>',
timeWindowSize: 5,
timeWindowUnit: 'm',
+ hasTermsAgg: false,
threshold: 1000,
};
diff --git a/x-pack/legacy/plugins/watcher/__jest__/client_integration/watch_edit.test.ts b/x-pack/legacy/plugins/watcher/__jest__/client_integration/watch_edit.test.ts
index fb23a86980a33..207034ef1e2fd 100644
--- a/x-pack/legacy/plugins/watcher/__jest__/client_integration/watch_edit.test.ts
+++ b/x-pack/legacy/plugins/watcher/__jest__/client_integration/watch_edit.test.ts
@@ -191,6 +191,7 @@ describe.skip('', () => {
});
const latestRequest = server.requests[server.requests.length - 1];
+
const {
id,
type,
@@ -217,9 +218,11 @@ describe.skip('', () => {
triggerIntervalUnit,
aggType,
termSize,
+ termOrder: 'desc',
thresholdComparator,
timeWindowSize,
timeWindowUnit,
+ hasTermsAgg: false,
threshold: threshold && threshold[0],
})
);
diff --git a/x-pack/legacy/plugins/watcher/public/models/watch/threshold_watch.js b/x-pack/legacy/plugins/watcher/public/models/watch/threshold_watch.js
index db595738bcd02..c842e25fb1f5d 100644
--- a/x-pack/legacy/plugins/watcher/public/models/watch/threshold_watch.js
+++ b/x-pack/legacy/plugins/watcher/public/models/watch/threshold_watch.js
@@ -256,9 +256,11 @@ export class ThresholdWatch extends BaseWatch {
aggField: this.aggField,
termSize: this.termSize,
termField: this.termField,
+ termOrder: this.termOrder,
thresholdComparator: this.thresholdComparator,
timeWindowSize: this.timeWindowSize,
timeWindowUnit: this.timeWindowUnit,
+ hasTermsAgg: this.hasTermsAgg,
threshold:
comparators[this.thresholdComparator].requiredValues > 1
? this.threshold
diff --git a/x-pack/legacy/plugins/watcher/server/models/watch/base_watch.js b/x-pack/legacy/plugins/watcher/server/models/watch/base_watch.js
index 4e7f97316bd1b..ea09fac6f8523 100644
--- a/x-pack/legacy/plugins/watcher/server/models/watch/base_watch.js
+++ b/x-pack/legacy/plugins/watcher/server/models/watch/base_watch.js
@@ -66,16 +66,6 @@ export class BaseWatch {
return json;
}
- // to Elasticsearch
- get upstreamJson() {
- const watch = this.watchJson;
-
- return {
- id: this.id,
- watch,
- };
- }
-
// from Kibana
static getPropsFromDownstreamJson(json) {
const actions = map(json.actions, action => {
diff --git a/x-pack/legacy/plugins/watcher/server/models/watch/base_watch.test.js b/x-pack/legacy/plugins/watcher/server/models/watch/base_watch.test.js
index bf7889473b60d..c83fbc0b4564c 100644
--- a/x-pack/legacy/plugins/watcher/server/models/watch/base_watch.test.js
+++ b/x-pack/legacy/plugins/watcher/server/models/watch/base_watch.test.js
@@ -188,50 +188,6 @@ describe('BaseWatch', () => {
});
});
- describe('upstreamJson getter method', () => {
- let props;
- beforeEach(() => {
- props = {
- id: 'foo',
- name: 'bar',
- type: 'json',
- watchStatus: {
- downstreamJson: {
- prop1: 'prop1',
- prop2: 'prop2',
- },
- },
- actions: [
- {
- downstreamJson: {
- prop1: 'prop3',
- prop2: 'prop4',
- },
- },
- ],
- };
- });
-
- it('should return a valid object', () => {
- const watch = new BaseWatch(props);
-
- const actual = watch.upstreamJson;
- const expected = {
- id: props.id,
- watch: {
- metadata: {
- name: props.name,
- xpack: {
- type: props.type,
- },
- },
- },
- };
-
- expect(actual).toEqual(expected);
- });
- });
-
describe('getPropsFromDownstreamJson method', () => {
let downstreamJson;
beforeEach(() => {
diff --git a/x-pack/legacy/plugins/watcher/server/models/watch/json_watch.js b/x-pack/legacy/plugins/watcher/server/models/watch/json_watch.js
index 578461f4f3f74..dbb34e971f94a 100644
--- a/x-pack/legacy/plugins/watcher/server/models/watch/json_watch.js
+++ b/x-pack/legacy/plugins/watcher/server/models/watch/json_watch.js
@@ -23,12 +23,6 @@ export class JsonWatch extends BaseWatch {
return serializeJsonWatch(this.name, this.watch);
}
- // To Elasticsearch
- get upstreamJson() {
- const result = super.upstreamJson;
- return result;
- }
-
// To Kibana
get downstreamJson() {
const result = merge({}, super.downstreamJson, {
diff --git a/x-pack/legacy/plugins/watcher/server/models/watch/json_watch.test.js b/x-pack/legacy/plugins/watcher/server/models/watch/json_watch.test.js
index 56150667b609e..0301c4c95be94 100644
--- a/x-pack/legacy/plugins/watcher/server/models/watch/json_watch.test.js
+++ b/x-pack/legacy/plugins/watcher/server/models/watch/json_watch.test.js
@@ -52,26 +52,6 @@ describe('JsonWatch', () => {
});
});
- describe('upstreamJson getter method', () => {
- it('should return the correct result', () => {
- const watch = new JsonWatch({ watch: { foo: 'bar' } });
- const actual = watch.upstreamJson;
- const expected = {
- id: undefined,
- watch: {
- foo: 'bar',
- metadata: {
- xpack: {
- type: 'json',
- },
- },
- },
- };
-
- expect(actual).toEqual(expected);
- });
- });
-
describe('downstreamJson getter method', () => {
let props;
beforeEach(() => {
diff --git a/x-pack/legacy/plugins/watcher/server/models/watch/threshold_watch/threshold_watch.js b/x-pack/legacy/plugins/watcher/server/models/watch/threshold_watch/threshold_watch.js
index 420d778ec5f79..ebef741200e00 100644
--- a/x-pack/legacy/plugins/watcher/server/models/watch/threshold_watch/threshold_watch.js
+++ b/x-pack/legacy/plugins/watcher/server/models/watch/threshold_watch/threshold_watch.js
@@ -55,12 +55,6 @@ export class ThresholdWatch extends BaseWatch {
return formatVisualizeData(this, results);
}
- // To Elasticsearch
- get upstreamJson() {
- const result = super.upstreamJson;
- return result;
- }
-
// To Kibana
get downstreamJson() {
const result = merge({}, super.downstreamJson, {