call a function from jelly g:evaluate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2017 10:30 AM
How do I create a function that jelly g:evaluate can call to avoid repeating code?
<g:evaluate var="jvar_caseGr">
var url = '${sysparm_url}';
commonMethod(url);
</g:evaluate>
<g:evaluate var="jvar_abc">
var url = '${sysparm_abc}';
commonMethod(url);
</g:evaluate>
<g:evaluate var="jvar_test">
var url = '${sysparm_test}';
commonMethod(url);
</g:evaluate>
commonMethod(url) {
...some code
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2017 10:31 AM
You write a Script Include, and call it from the Evaluate.
convert commonMethod to a Script Include class and use it.