I have custom field of type assignee, in vm template I have following code :
<td width="80%"> $issue.getCustomFieldValue($customFieldManager.getCustomFieldObject("customfield_10510"))
</td>
I get result as assignname plus extra number e.g john-10001 , but I want display name as "John Smith"
Please let me know the solution.
Thanks
MR
You have not got a custom field of type "assignee", I suspect you mean "user picker"? (Assignee is a system field, you can't add more)
Anyway, your code is fetching the content of a custom field. In most cases, this will be an object, which you then need to question further to get a human description instead of a best-guess representation of the object. For a user object, you usually use .getDisplayName().
In short, try
$issue.getCustomFieldValue($customFieldManager.getCustomFieldObject("customfield_10510")).getDisplayName()
Kewl. There is some documentation on Apache Velocity's site at http://velocity.apache.org/, but the layout of the site is awful and it's dreadful to try to find anything useful, and even then, there's no obvious examples or human-friendly guides. The closest I've found to anything readable is https://velocity.apache.org/engine/devel/user-guide.html
It's also generalised, and most people here need more about the Atlassian stuff than velocity. My fallback there is https://developer.atlassian.com/pages/viewpage.action?pageId=4227172and a bit of brute force "try exposing all the context and see what's actually useful"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nic,
getDisplayName(), resolved the issue.
Also is there any proper documentation on VM templates development or list of all functions.
Please lets know. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.