Hello
I have a plugin that is displaying a vm template that is supose to display a customfield value. I've looked through the other questions and answer online and the solutions are not working for me. I am running Jira 7.13.5
The error I'm getting is Nullpointer exception on the set $cfVal line.
I've ensured the test data has no NULLs
I also tried just displaying: $customFieldManager.getCustomFieldObject("customfield_15206").getName()
but this only resulted in $customFieldManager.getCustomFieldObject("customfield_15206").getName() being display and not the value it was as if this value was not parsed by the template.
#disable_html_escaping()
#foreach( $issue in $issues )
#if ($issue.getCustomFieldValue($customFieldManager.getCustomFieldObject("customfield_15206")))
#set($cfVal = $issue.getCustomFieldValue($customFieldManager.getCustomFieldObject("customfield_15206")))
$cfVal
#else
No Value
#end
#end
Is there any thing extra need in the main Java function before rendering the template or in the plugin.xml?
Any help would be apperciated.
Thanks,
Neil
Hi @Neil Dixon
To use customFieldManager object in vm template, you need to add it to velocity context in your servlet code.
Are you sure, you are putting an instance in server side?
Hi
Thanks for the help.
I added
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
context.put("customFieldManager", customFieldManager);
To my servelt code and it is working.
Neil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.