/
context
context
Functions
[void] set([string] key, [object] value); // attach an object to context of a page by given key [object] get([string] key); // get the object that attached to context with given key
Examples
Attaching objects to page context
var jsonResult=JSON.parse(http.get("http://ci.jenkins/api/json?depth=1","jenkins")); context.set("jenkinsJson",jsonResult); context.set("my-message","Hello World");
Using objects that has been attached to page context
var jenkins=context.get("jenkinsJson"); print(jenkins.jobs.length); var m=context.get("my-message"); out.element("h2",m);
Output:
5