How to return a partial view from WebWork action or command?

I have some parts of my plugin which are loaded through AJAX on demand. Now there is a problem that although my velocity template for that command does not contain html head nor body tags, still JIRA inserts them automatically when I request it from http://localhost:2990/jira/secure/MyAction!myCommand.jspa?_=1386174672969.

How do I return only HTML structure from my own .vm view and stop JIRA from injecting its headers and body?

2 answers

Thanks you brought me on the right way, I think

<meta name="decorator" content="none">

i what you are looking for.

After some inspection on default JIRA pages as workaround I did it like this:

<html>
    <head>
        <!-- the following must be present to keep the partial view only. 
            at first I tried atl.popup as suggested in the docs, but it did not work -->
        <meta name="decorator" content="dialog">
    </head>

    <body>
...

The response is now clear from head tags and whatnot, but there are some other lines added:

<div class="jira-dialog-content">
        <div class="dialog-title hidden"></div>

which is not a big deal - I can filter them client side with some jQuery.

Still, I'm not sure that's the "official" way to achieve the desired behavior...

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 10 hours ago in Off-topic

Get to know our Atlassian User Group Leaders from Bengaluru, India

Meet @Dinesh Dhinakaran, @Vishnu Vasudeva, @Rajeev Verma, and Jamshid Nalakath: Our extraordinary AUG leaders from Bengaluru, India. These four work together to strengthen the bonds of their local co...

85 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you