Macro execute() method- renderContext.getOutputType() always returns "display"

Hi everyone,
I am currently developing a macro plugin for Jira Data-Center.
I want the Macro to display the text “Hello”, but when exporting the issue to word, I want the macro to render the following text: “Hello - word export”.

Looking at the documentation of RenderContext class: RenderContext (Atlassian Renderer 5.0 API) , and RenderContextOutputType (Atlassian Renderer 5.0 API), I assumed, that the renderContext.getOutputType() inside the execute() should return the output type, e.g: Word, PDF, XML, etc… But the function always returns the value: “display”, even when the issue is exported to Word.

atlassian-plugin.xml file:

<atlassian-plugin key="${atlassian.plugin.key}" name="${}" plugins-version="2">
        <vendor name="${}" url="${project.organization.url}" />
        <param name="plugin-icon">images/pluginIcon.png</param>
        <param name="plugin-logo">images/pluginLogo.png</param>
    <macro key='hello' name='{hellol} formatting macro'
    	<description>Insert footer content with regards.</description>
    	<param name="convert-selector">div.hello-macro:not(.uml-img-ignore)</param>
    	<param name="convert-function">Plugin.Macros.Hello.convert</param>
	<web-resource key="handler3" name="JIRA Editor Reference Plugin Context Init">
    	<resource name="soy/" type="download" location="soy/" />

    	<transformation extension="soy">
        	<transformer key="soyTransformer"/>
</atlassian-plugin> class:

public class HelloMacro extends BaseMacro {

	    public boolean hasBody() {
	        return true;

	    public RenderMode getBodyRenderMode() {
			return RenderMode.allow(RenderMode.F_ALL).and(RenderMode.suppress(RenderMode.F_MACROS));

	    public String execute(Map<String, Object> parameters, String body, RenderContext renderContext) throws MacroException {
// This is always returning 'display'
	    	String outputType = renderContext.getOutputType();
	    	if( RenderContext.WORD.equals(outputType)) return "<h1>Hello: Word export</h1>";
	    	return "Hello";


{namespace Plugin.Macros.Hello}
 * @param content
{template .html}

 * @param content
{template .wiki}

 * @param innerMarkup
{template .convert}

Right now, when I export the issue to Word, I see “Hello” in the issue description.
Can someone help me understand why the renderContext.getOutputType() always returning ‘display’ ?
I tried developing the same plugin for Confluence, and it works.

Thanks in advance!

1 Like