Confluence Jira Issue Macro does not display custom fields!

SUNIL KUMAR CHINNAMGARI January 2, 2012

Hello,

I am evaluating confluence and jira integration. I am unable to get the jira issue macro display the custom fields! I have one field "I Promised I Will FLT On" which is on free text type and another one "Project Name" of text type 9255 charcters) which are available on issues which I want to get on the issue macro. I can see from the filter xml that the fields do exists on the filter URL used by issue macro but I just can't understand where I am doing somethig wrong!

Screen prints attached for your review. Appeciate your quick help. Thanks!

<customfield id="customfield_10610" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
<customfieldname>I Promised I Will FLT On (4)</customfieldname>

<customfieldvalues>
<customfieldvalue>&nbsp;</customfieldvalue>
</customfieldvalues>
</customfield>

<customfield id="customfield_10202" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
<customfieldname>Project Name</customfieldname>

<customfieldvalues>
<customfieldvalue>Hima Bindu</customfieldvalue>
</customfieldvalues>
</customfield>

4 answers

1 accepted

5 votes
Answer accepted
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 2, 2012

Don't have a direct answer to display the custom field in jiraissues macro. But you can add the "Filter Results" portlet of Jira directly to Confluence (refer http://confluence.atlassian.com/display/DOC/External+Gadgets), and there you can select whatever you want to display (the same way you would have done on a Jira Dashboard).

Does this help?

AM November 17, 2012

Renjith, you just made my day! It's an excellent workaround.

Why workaround? Because the downside is: it does not create a "clickable" JIRA items list compared to the "JIRA issue gadget".

Again, thanks!

-AM-

Like Роман Волков likes this
8 votes
Gaurav Verma October 5, 2014

Its been a while since this question has been asked but I was myself confronted with the same problem very recently. Custom field data just did not appear for the JIRA issue macro in Confluence. 

After a lot of experiments and RTM, I found the solution. The custom fields needs to have a xml velocity template included in the field definition. 

&lt;resource type="velocity" name="xml" location="/templates/heat-map-riskstatus-cfield/xml-color.vm"/&gt;

The sample for this velocity template is 

#disable_html_escaping()
#if($renderedValue)
&lt;customfieldvalue&gt;$xmlutils.escape($renderedValue)&lt;/customfieldvalue&gt;
#elseif ($value)
&lt;customfieldvalue&gt;$value&lt;/customfieldvalue&gt;
#end

HTH

 

Deleted user October 12, 2016

It worked! You're a genius! You have made me to avoid a huge waste of time.

Like RentalHost likes this
Brittany Woerner January 11, 2017

Could you please share details on how you were able to get the custom field data to show in the Confluence macro? I am still not having any luck... Kind regards.

Dean Holmes April 27, 2018

Could you give detailed step by step guide how to do this. We have a requirements doc, with then want create a new epic or story and need a custom field in that macro dialogue.

 

Thanks

Suryanarayana Murthy Annavajjhula March 14, 2019

Hi Gaurav, 

It would be great if you can explain the solution in detail. I am stuck with Jira issue macro not rendering the custom fields. Thanks in advance. My email id asnmurthy@gmail.com

 

Please help.

tom-42mo August 29, 2019

Superb! Thanks for the solution.

Wendy Schaeffer September 23, 2019

Can someone provide some details in how this is done?  

How do the access the field definitions for the custom fields to add the xml velocity template?

Any and all help is greatly appreciated.

TIA!!

tom-42mo September 25, 2019

As Confluence apparently uses the XML output of JIRA to display issue tables in its macros, you need to be able to show your custom field in XML. You can view what the issue's XML is by opening the issue, hitting the Export button on the top right and selecting XML from there (or just navitating to the XML url: YOUR_JIRA_URL/si/jira.issueviews:issue-xml/ABC-123/ABC-123.xml).

The end goal is for your custom field to show up in this XML.

The way to achieve it is, as Gaurav described, to add a Velocity template corresponding to the XML output to your atlassian-plugin.xml file:

<customfield-type name="Your Field" class="com.class.path.to.YourField" ...>
<resource name="view" location="/templates/customfields/your-field/view.vm" type="velocity" />
<resource name="xml" location="/templates/customfields/your-field/xml.vm" type="velocity" />
</customfield-type>

Where xml.vm looks very similar to your view.vm and can be as simple as:

#disable_html_escaping()
#if($value)
<customfieldvalue>$value</customfieldvalue>
#end

The latter can vary depending on how your HTML template ("view" resource) looks like. The XML tempalte has to output valid XML (duh) :)

Like # people like this
KMuthukumar-RP July 22, 2020

@tom-42mo,
                I am assuming that we need to do this in Jira and restart Jira right?

I am having same issue. But the caveat is that, the custom field values used to show fine before our last weekend upgrade of Confluence from 6.12.1 to 7.4., but after the upgrade they dont show. Even now the custom field values show fine in Issue Navigator in Jira and XML export in Jira, but not in Conf page Jira issues macro. Just that some (not all) custom fields are not showing value in Confluence page. One more confusion is that, which value show up differ between different confluence instances, even though they both are same version 7.4.1. Basically, since my prod instance of confluence was having issue showing some field values, I had connected my dev confluence as well to the same instance of Jira to test. In dev instance of confluence, it shows the value for some cf's, lets say CF1 & CF2, but not CF3 and the prod instance of confluence shows the value for CF3, but not CF1 & CF2.

Not sure what is going on. Any help is appreciated.

Like Роман Волков likes this
tom.valja July 23, 2020

Yes, that worked for me. I'm sorry but I hope somebody else will be able to chip in. I've since changed companies and we use JIRA Cloud here, which conveniently doesn't allow such extensions, so I resolved all my problems this way 😅

Anne Warmer August 3, 2020

@KMuthukumar-RP ,

have you found a solution? I am having the same problem. The custom fields used to show prior to our upgrade to Confluence Version 7.4.1.

Very annoying. Anybody here who can help? I definitely do not want to mess with velocity templates, since it used to work just fine.

Like # people like this
Michal Bugajny _buGi_ October 29, 2020

Hi,

so how exactly should I add this "velocity"?

I assume it must have been done in the very custom fiels setup, right?

Michal Bugajny _buGi_ October 30, 2020

Ok, in my case it took a night to "bind" jira and confluence (clouds). It just started working in the morning

Nick Yang
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 20, 2020

XML output is deprecating in both Jira and Confluence.  Please contact support team on https://getsupport.atlassian.com/ for any missing fields issues in your jira issue macro. 

Thanks a lot

0 votes
Xianyang Wong November 18, 2020

 

Anyone is having the issue again?

Nick Yang
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 20, 2020

Please contact support team on https://getsupport.atlassian.com/ for any missing fields issues in your jira issue macro. 

Thanks a lot

Lloyd Dukes December 1, 2020

I'm certainly having this issue. Just discovered the values in my custom fields are no longer being displayed in my Confluence pages. These pages were built in Sep. 2020. These custom fields were providing a lot of needed information to the end-user. Now my Confluence pages are virtually useless. I'm going to try and report it but not holding my breath for a solution.

Like James Poole likes this
MA March 8, 2021

Any luck @Lloyd Dukes ?

I'm having the same issue - the Jira Issues macro doesn't work with the custom fields that I want to display in confluence for reporting purposes.

For some fields I can use the Jira Filter macro, but it's pretty hit and miss.  It also means the report looks pretty ugly if you are using a combination of these macros (They don't look good next to each other)

Karen Hayden April 29, 2021

I, too, am having the same issue (Confluence server v7.51; firefox browser).  This is so frustrating as I am trying to promote use of these products in our department and these issues cause our resources to go elsewhere.  If this keeps up, I forsee us dropping Atlassian tools altogether.

0 votes
Janis Rozenblats January 12, 2015

Hey guys,

Not sure if you can help me here or direct to another issue, but I need to be able to assign a JIRA issue that i'm creating from the Confluence page.

Right now there is no option to assign an issue to anybody, it is automatically assigned to project lead, this means I have to go to JIRA afterwards and manually assign to the correct person in JIRA. Just seems very inconvenient.

Thanks
Janis

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events