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

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 ?

Just to be sure:

You have added the field, to the view?

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

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
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,378 views 15 19
Read article

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