Is there a way to display object variables inside the velocity template?
It only seems to work with "toString()". I saw something about wrapping the object, but how would this be possible in jira?
example:
java class:
class a
{
public String name;
public String getName(){return "test";}
public String fullUsername = "test";
@Override
public String toString() {return "test";}
}
context.put("object", new a());
velocity template:
<html>
<head>
<title>test</title>
<meta name="decorator" content="atl.general">
</head>
<body>
<form id="" class="aui" action="" method="post">
<td>$object.getName()</td> <!-- does not work -->
<td>$object.toString()</td> <!-- works!!! -->
<td> $object.name </td> <!-- does not work -->
</form>
</body>
</html>
Thank you for your time!
Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!
Join an Atlassian Community Event!