Gantt Chart Field in Confluence - e.g. JIRA Filter Results Gadget

Stuart Wright September 3, 2013

Hi Frank (and everyone),

I'm trying to display the Gantt Chart field in a JIRA Gadget (e.g. Filter Results Gadget) on a Confluence page. The intention is to display a nice overview of tasks that are pending / in progress, based on any filter that I like.

(Ideally this would be displayable to an anonymous user - the JIRA / Confluence instances are basically wide-open internally, without the ability to actually login to either of them.)

When I display the filter with the Gantt Chart field, the gadget shows up empty. When I remove the field the data is all OK. This isn't the end of the world, because the "Planned Start" / "Planned End" / "Due Date" etc can be displayed OK, but I'd like to have a visual cue for people. It aids readability and glance-ability.

Should the field work in situations like this, and am I doing something wrong here? If it should work, can you have a quick look into it, or give me some advice as to how I make this happen?

Kind regards, Stuart.

4 answers

0 votes
Frank Polscheit
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.
September 11, 2013

Hi Stuart,

as project administrator, you can configure for whom the related Gantt-Chart is visible:

0 votes
Frank Polscheit
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.
September 10, 2013

Hi Stuart,

please give it a try (see Justin's posting referenced above): I have not done this before and be interested in your result.

If you are not logged in (anonymous access), you can try using the AJAX-URLs to JIRA from a different browser tab to get better feedback: just take the URLs from the network section of e.g. FireBug or Chrome Dev.-Tools and copy/paste them.

Regards,
Frank

Stuart Wright September 11, 2013

Hi Frank,

I've tried the "Acces-Control-Allow-Origin" method, and it seems to do what is required (the header is returned with the correct domain allowed). So I don't think it's anything related to CROS.

Trawling through the page using the Dev Tools has thrown up messages such as the output below.

It must be a permissions thing. I had assumed that if the filter/page/gadget was setup using my ID, then that would be sufficient credentials to enable this to work. The project Gantt setting are setup for use by everyone, but I guess that doesn't mean anonymous?

Best regards, Stuart.

<td class=\\\"nav customfield_12415\\\"><!-- (c) Copyright by Frank Polscheit (mailto:frank@polscheit.de), 2012 to 2013 -->

{\\n\\t\\t\\tvar msg = \\\"You do not have the permission necessary for displaying as Gantt-Bar:PHNX-476\\\";\\n\\t\\t\\tvar prj = msg.split(\\\":\\\")[1].trim();\\t\\t\\t\\n\\t\\t\\tvar msgs = AJS.$(\\\"#aui-message-bar\\\").children();\\n\\t\\t\\tvar found = false;\\n\\t\\t\\tfor (var idx=0; idx<msgs.length; idx++) {\\n\\t\\t\\t if (msgs[idx].innerHTML.indexOf(\\\"Please enable following project(s) for use with Gantt-Charts:\\\") > -1)

AJS.messages.warning('#aui-message-bar', { title: \\\"Contact your (project) administrator:\\\", body: msg, closeable: true, shadowed: true });\\n\\t\\t}, 500);\\n\\t<\/script>\\n\\n<\/td>\\n <\/tr>

Stuart Wright September 11, 2013

Hi Frank,

OK, I was too quick to jump.

I've checked the system config for the plugin and it is limited to a Project Role I had setup for users.

I'd like to open this up - but I can't select "no project role" or a group (anyone) equivalent.

Is this possible?

Best, Stuart.

0 votes
Frank Polscheit
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.
September 10, 2013

Just for verifcation: does my Gantt-Chart Gadget - put on your dashboard instead of or additional to the filter result gadget - work fine within your environment?

Regards,
Frank

Stuart Wright September 10, 2013

Hi Frank,

Yes it's fine on a dashboard. Tests I have done:

- Gantt Chart gadget on a JIRA dashboard (all OK).

- Gantt Chart gadget on a Confluence page (all OK, logged in or anonymous).

- Gantt Chart field on a Confluence page (OK logged in, not OK anonymous).

I see that this does differ from what I said originally - it's only a problem when accessing the filter gadget anonymously. Sorry for the misleading information Frank.

When accessing it anonymously the entire filter is not displayed, however when looking at exactly the same page on a second screen it's all there.

(I have the Gantt Chart gadget on top, a filter results gadget without Gantt Chart in the middle, and only one screen shows the filter results gadget with Gantt Chart.)

I thought of using Justin Reherman's comment from this post, based on your earlier communication:

https://answers.atlassian.com/questions/69356/cross-origin-resource-sharing-with-jira-rest-api-and-javascript

Best regards, Stuart.

0 votes
Frank Polscheit
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.
September 3, 2013

Hi Stuart,

the difference between normal data and my Gantt-Chart is, that the last one loads additional data via AJAX using JIRA's baseUrl. Please ensure, that your local setup of Confluence and JIRA do not violate the "same origin policy". This security aspect might block your Gadget!

My suggestion is to configure baseUrls llike "http://my.company.com:8080/confluence" and "http://my.company.com:8080/jira" in order to fullfil the security requirements (keep same internet-protocol, domain and port for Confluence and JIRA). If you want to operate with 2 different Tomcats, each per Atlassian application, you should put a http-server like Apache in front of them on "http://my.company.com:8080", redirecting to JIRA or Confluence based on the following path.

Regards,
Frank

Stuart Wright September 3, 2013

Hi Frank,

Thanks for the quick reply, it's great support from you.

The JIRA and Confluence do run on the same server: HTTPS to Apache (acting as the SSL endpoint) proxying AJP to /jira and /confluence contexts. e.g.:

https://our.com/jira -> Apache -> ajp://localhost:8008/jira

https://our.com/confluence -> Apache -> ajp://localhost:8009/confluence

The two applications are running under separate tomcats.

The BASE URLs are the "https" URLs mentioned above, and the SSL certs are loaded into the keystores etc.

Trusted Application Links work fine, now, after some initial problems - they are set to the same BASE URLs mentioned above.

However your mention of the "same origin policy" issue is a touch beyond my skills I'm afraid. I'm unsure if the configuration matches the expectation or not?

Shouldn't the JIRA Gadget that is resident in Confluence use the Application Links URL, in which case it would think that it is on the same server, with the same port etc?

Again, thanks for your help.

Kind regards, Stuart.

Stuart Wright September 10, 2013

Hi Frank,

Do you have any other suggestions or comments for this? I'm not sure if I'm doing something wrong here, and if you have something to add I'd appreciate your guidance.

Kind regards, Stuart.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events