jira custom field plugin - field value not showing on view screen

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;

4 answers

This widget could not be displayed.
If you set calculatedValue in the map you should also use $calculatedValue instead of $value in the velocity template

did that, but this value only shows on the column view (issue navigator), the value won't show in the ticket view screen.

Do you have two velocity templates, one for view and one for column-view ?
This widget could not be displayed.

Just to be sure:

You have added the field, to the view?

This widget could not be displayed.

Have you added field to screen, have permission to view it ? :)

This widget could not be displayed.

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...

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

209 views 1 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you