So I created a custom field plugin for JIRA. Everything is working fine except that the $value in the volocity template for 'view' screen is not shown on the view ticket screen.
I implemented this override function:
public Map getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem)
and return a value at end of the function, i.e.:
params.put("calculatedValue", calculatedValue);
return params;
im experiencing the same problem. I have been working nicely with some other custom fields that are only used on edit screens. For the first CF used on a view screen, i cannot get it to be displayed. The CFs configuration scheme is "global - all issues". Here is my override method(started from the SDK template)
public Map<String, Object> getVelocityParameters(final Issue issue, final CustomField field, final FieldLayoutItem fieldLayoutItem) { log.info("Entered getVelocityParametersVIEW"); final Map<String, Object> map = super.getVelocityParameters(issue, field, fieldLayoutItem); // This method is also called to get the default value, in // which case issue is null so we can't use it to add currencyLocale if (issue == null) { map.put("item", "nothing"); return map; } FieldConfig fieldConfig = field.getRelevantConfig(issue); //add what you need to the map here map.put("item", "something"); return map; }
when editing the default value, $item is "something" (which also puzzles me, but anyways)
when viewing the configuration info, $item is not set (displays as "$item")
when viewing an issue that has this CF on its view screen, the CF isnt displayed. Also cant find the customfield_# in the HTML source. This tells me that JIRA thinks that this field has no value, which coincides with what i described above. So i must be setting the value of this field incorrectly?
Change in direction : I just created a new issue after installing my said custom field and it displayed on the view screen. So this makes sense to me having worked with issues and other custom fields. So now my question is, for my plugin-custom-field, how do i get "all" issues to display it? and not just issues created after the installation of my plugin-custom-field? I guess i could set a value for all issues, but that sounds so inelegant...
Have you added field to screen, have permission to view it ? :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to be sure:
You have added the field, to the view?
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.
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.