# Execute Watch w/ vars

**URL:** <https://discuss.elastic.co/t/execute-watch-w-vars/28208>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [August 27, 2015, 9:44pm UTC](https://discuss.elastic.co/t/execute-watch-w-vars/28208 "2015-08-27T21:44:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aochsner](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@aochsner](https://discuss.elastic.co/u/aochsner)\
**Post date:** [August 27, 2015, 9:44pm UTC](https://discuss.elastic.co/t/execute-watch-w-vars/28208/1 "2015-08-27T21:44:11Z")

</div>

Is there a way to set some vars in the execution context when a watch is executed via the Execute Watch API?

I am writing some end to end tests and would like to change a couple fields when testing vs when executed normally. I know how to make the mustache scripts work if I could only put them in...

Thanks

---

<div class="post-metadata">

**Author:** ![uboness](https://avatars.discourse-cdn.com/v4/letter/u/96bed5/32.png) [@uboness](https://discuss.elastic.co/u/uboness)\
**Post date:** [August 27, 2015, 10:12pm UTC](https://discuss.elastic.co/t/execute-watch-w-vars/28208/2 "2015-08-27T22:12:41Z")

</div>

Currently the execute API doesn't enable you to provide initial vars for the execution context. It's an interesting use case though. The execute API does enable you to define an alternative input, would that do the trick?

---

<div class="post-metadata">

**Author:** ![aochsner](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@aochsner](https://discuss.elastic.co/u/aochsner)\
**Post date:** [August 28, 2015, 1:35pm UTC](https://discuss.elastic.co/t/execute-watch-w-vars/28208/3 "2015-08-28T13:35:58Z")

</div>

Probably not for what I'm trying to accomplish which is to create an end-to-end test that proves my System Under Test is creating watches correctly and prove it by executing said watch w/ some known data. However, I might go down that path for a lower level unit/integration test.

Thanks anyways!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:48pm UTC](https://discuss.elastic.co/t/execute-watch-w-vars/28208/4 "2017-07-06T13:48:47Z")

</div>


