In the documentation of the JIRA Issues Macro for the paramater "baseurl" I found this text:

      "... This is useful when Confluence connects to JIRA with a different URL from the one used by other users. "

      But the baseurl parameter only solves half of the problem. The links to the Jira issues as well as the links to the images in the table still contain the url which confluence uses to connect to Jira. Unfortunately these links cannot be resolved in the browser.

            [CONFSERVER-15967] JIRA Issues Macro URL problem

            TruongA added a comment -

            It was already fixed on CONF-29182.

            TruongA added a comment - It was already fixed on CONF-29182 .

            I have this working in static and dynamic modes now.

            Ronald Horner added a comment - I have this working in static and dynamic modes now.

            Also of note I updated a couple other files

            atlassian-plugin.xml
            <xhtml-macro name="jiraissues" class="com.atlassian.confluence.extra.jira.JiraIssuesMacro" key="jiraissues-xhtml"  documentation-url="help.jira.issues.macro">
                <description key="jira.macro.jira.issues.description"/>
                <category name="external-content"/>
                <category name="development"/>
                <parameters>
                    <parameter name="url" type="url" required="true"/>
                    <parameter name="baseurl" type="url"/>
                    <parameter name="columns" type="string">
                        <!-- todo enum with multiple values? -->
                        <!--<value name="key"/>-->
                        <!--<value name="summary"/>-->
                        <!--<value name="type"/>-->
                        <!--<value name="created"/>-->
                        <!--<value name="updated"/>-->
                        <!--<value name="assignee"/>-->
                        <!--<value name="reporter"/>-->
                        <!--<value name="priority"/>-->
                        <!--<value name="status"/>-->
                        <!--<value name="resolution"/>-->
                    </parameter>
                    <parameter name="count" type="boolean"/>
                    <parameter name="cache" type="enum" default="on">
                        <value name="on"/>
                        <value name="off"/>
                    </parameter>
                    <parameter name="anonymous" type="boolean" default="false"/>
                    <parameter name="width" type="string" default="100%"/>
                    <parameter name="height" type="int" default="480"/>
                    <parameter name="title" type="string" />
                    <parameter name="renderMode" type="enum" default="dynamic">
                        <value name="dynamic"/>
                        <value name="static"/>
                    </parameter>
                </parameters>        
            </xhtml-macro>
            
            jiraissues.properties
            confluence.extra.jira.jiraissues.param.baseurl.label=Clickable URL
            confluence.extra.jira.jiraissues.param.baseurl.desc=If the clickable URL needs to be different than the request URL.
            

            Ronald Horner added a comment - Also of note I updated a couple other files atlassian-plugin.xml <xhtml-macro name= "jiraissues" class= "com.atlassian.confluence.extra.jira.JiraIssuesMacro" key= "jiraissues-xhtml" documentation-url= "help.jira.issues.macro" > <description key= "jira.macro.jira.issues.description" /> <category name= "external-content" /> <category name= "development" /> <parameters> <parameter name= "url" type= "url" required= " true " /> <parameter name= "baseurl" type= "url" /> <parameter name= "columns" type= "string" > <!-- todo enum with multiple values? --> <!--<value name= "key" />--> <!--<value name= "summary" />--> <!--<value name= "type" />--> <!--<value name= "created" />--> <!--<value name= "updated" />--> <!--<value name= "assignee" />--> <!--<value name= "reporter" />--> <!--<value name= "priority" />--> <!--<value name= "status" />--> <!--<value name= "resolution" />--> </parameter> <parameter name= "count" type= " boolean " /> <parameter name= "cache" type= " enum " default = "on" > <value name= "on" /> <value name= "off" /> </parameter> <parameter name= "anonymous" type= " boolean " default = " false " /> <parameter name= "width" type= "string" default = "100%" /> <parameter name= "height" type= " int " default = "480" /> <parameter name= "title" type= "string" /> <parameter name= "renderMode" type= " enum " default = "dynamic" > <value name= "dynamic" /> <value name= " static " /> </parameter> </parameters> </xhtml-macro> jiraissues.properties confluence.extra.jira.jiraissues.param.baseurl.label=Clickable URL confluence.extra.jira.jiraissues.param.baseurl.desc=If the clickable URL needs to be different than the request URL.

            I've used your patch on the latest 4.0.5 and added a small modification. Unfortunately this only works in static render mode right now.

            JiraIssuesManager.Channel channel = jiraIssuesManager.retrieveXMLAsChannel(url, columnNames, appLink, forceAnonymous);
            Element element = channel.getChannelElement();
            
            // the tasty bits start right here
            if (StringUtils.isNotEmpty(baseUrl)) {
            	baseUrl = baseUrl.trim();
            	Iterator it = element.getChildren("item").iterator();
            	while (it.hasNext()) {
            		Element e = (Element) it.next();
            		e.getChild("link").setText(rebaseUrl(e.getChild("link").getText().toString(), baseUrl));
            		e.getChild("type").setAttribute("iconUrl", rebaseUrl(e.getChild("type").getAttributeValue("iconUrl"), baseUrl));
            		e.getChild("status").setAttribute("iconUrl", rebaseUrl(e.getChild("status").getAttributeValue("iconUrl"), baseUrl));
            		e.getChild("priority").setAttribute("iconUrl", rebaseUrl(e.getChild("priority").getAttributeValue("iconUrl"), baseUrl));
            	}
            	element.getChild("link").setText(rebaseUrl(element.getChild("link").getValue(), baseUrl));
            }
            // and stop here
            
            if(showCount)
            {
                Element totalItemsElement = element.getChild("issue");
                String count = totalItemsElement!=null ? totalItemsElement.getAttributeValue("total") : ""+element.getChildren("item").size();
                contextMap.put("count", count);
            }
            

            Does anyone have any idea on how to make this work in dynamic mode?

            Ronald Horner added a comment - I've used your patch on the latest 4.0.5 and added a small modification. Unfortunately this only works in static render mode right now. JiraIssuesManager.Channel channel = jiraIssuesManager.retrieveXMLAsChannel(url, columnNames, appLink, forceAnonymous); Element element = channel.getChannelElement(); // the tasty bits start right here if (StringUtils.isNotEmpty(baseUrl)) { baseUrl = baseUrl.trim(); Iterator it = element.getChildren( "item" ).iterator(); while (it.hasNext()) { Element e = (Element) it.next(); e.getChild( "link" ).setText(rebaseUrl(e.getChild( "link" ).getText().toString(), baseUrl)); e.getChild( "type" ).setAttribute( "iconUrl" , rebaseUrl(e.getChild( "type" ).getAttributeValue( "iconUrl" ), baseUrl)); e.getChild( "status" ).setAttribute( "iconUrl" , rebaseUrl(e.getChild( "status" ).getAttributeValue( "iconUrl" ), baseUrl)); e.getChild( "priority" ).setAttribute( "iconUrl" , rebaseUrl(e.getChild( "priority" ).getAttributeValue( "iconUrl" ), baseUrl)); } element.getChild( "link" ).setText(rebaseUrl(element.getChild( "link" ).getValue(), baseUrl)); } // and stop here if (showCount) { Element totalItemsElement = element.getChild( "issue" ); String count = totalItemsElement!= null ? totalItemsElement.getAttributeValue( "total" ) : ""+element.getChildren(" item").size(); contextMap.put( "count" , count); } Does anyone have any idea on how to make this work in dynamic mode?

            Would really like to see this functionality. Our servers communicate behind our externally available addresses. This is the same functionality as Application Links.

            Ronald Horner added a comment - Would really like to see this functionality. Our servers communicate behind our externally available addresses. This is the same functionality as Application Links.

            Are there any plans to fix this in the near future?

            Johannes Scharf added a comment - Are there any plans to fix this in the near future?

            Experianced exactly the same problem, only the header is adressed correctly. Tried it in Confluence 3.0.2!

            Michael Michael added a comment - Experianced exactly the same problem, only the header is adressed correctly. Tried it in Confluence 3.0.2!

            Anatoli added a comment -

            Hi Andreas, thanks for your patch. I have created an corresponding issue in the plugin's project: http://developer.atlassian.com/jira/browse/CONFJIRA-169.

            Anatoli.

            Anatoli added a comment - Hi Andreas, thanks for your patch. I have created an corresponding issue in the plugin's project: http://developer.atlassian.com/jira/browse/CONFJIRA-169 . Anatoli.

            Andreas Zinkl added a comment - - edited

            The base version of the JIRA-Confluence-Plugin always refers to the given "url", even if there's a "baseurl" configured. Thus the forwarding to JIRA does not work properly. So whenever a "baseurl" is set, the "link"-field and the "iconUrl"-field of each JIRA-issue described in the entries-object have to be modified.

            I've just added a very simple algorithm where I iterate through the "entries"-object and replace those URLs by calling the defined rebaseUrl(String, String)-method with those URLs and the "baseurl"-object as the necessary parameters.

            I also set the default renderMode to "static". Otherwise my algorithm I described above wouldn't have any effect.

            Another "bug":

            After installing the plugin, a ClassCastException occured every now and then at the getSort(String)-method where the sort status is loaded (cast from Sort to Sort). This can be avoided easily by storing the SortSettingsCache in an Object-variable first, before actually casting it to a Sort-Object.

            I hope this will be useful

            Andreas Zinkl added a comment - - edited The base version of the JIRA-Confluence-Plugin always refers to the given "url", even if there's a "baseurl" configured. Thus the forwarding to JIRA does not work properly. So whenever a "baseurl" is set, the "link"-field and the "iconUrl"-field of each JIRA-issue described in the entries-object have to be modified. I've just added a very simple algorithm where I iterate through the "entries"-object and replace those URLs by calling the defined rebaseUrl(String, String)-method with those URLs and the "baseurl"-object as the necessary parameters. I also set the default renderMode to "static". Otherwise my algorithm I described above wouldn't have any effect. Another "bug": After installing the plugin, a ClassCastException occured every now and then at the getSort(String)-method where the sort status is loaded (cast from Sort to Sort). This can be avoided easily by storing the SortSettingsCache in an Object-variable first, before actually casting it to a Sort-Object. I hope this will be useful

              Unassigned Unassigned
              ivan@atlassian.com Ivan Benko [Atlassian]
              Affected customers:
              8 This affects my team
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: