How to render Host Application Web Fragments inside of Add-On

Hi there,

I’m building a new type of JIRA navigator (using a general page), and I would like to render host application web fragments into a separate iframe contained in my Add-On.

For example, I would like to request a specific JIRA issue (html, not REST API), but then only show “div class=‘issue-view’” and below. I can think of a way to do this server side, but I would like to make HTML requests client side via AP.request or some other interface.

Is this method possible? I’m currently getting a 403 error when attempting to use AP.request in this manner, as it seems to be appending some type of query argument which seems to be not applicable for the regular URL.

AP.request will only allow you to call the whitelisted urls for your add-ons scope. Calling free form urls isn’t supported (it would be a security issue).

You’ll need to create your own version of things (which will be safer for you in the long run anyway).

If I do this server side, is the Authentication server going to let a user access those URLs? Or will that be blacklisted as well?

On server you can do whatever you want (which is both good and bad). Any ajax request you make will be part of the authenticated session (as long as you don’t do things like cors - then no guarantees :slight_smile: ).

I would still suggest creating your own version of things since html isn’t guaranteed to be the same between versions and you’ll probably have to check each patch version’s html if you’re parsing it.


Thanks, that’s a good point. Just to clarify, are you recommending that I create new html/js resources to present JIRA data (like issues and boards), or that I duplicate and maintain exisiting JIRA resources? Are we allowed to duplicate this code?