Jira popup from servlet

Hey everyone,

I have a JIRA plugin located at the system.top.navigation.bar with some web-items as dropdowns. The two web-items point to servlets.
In the servlets, I have a check in place, if true- execute business logic, else print a notification “You don’t have permission.”

What I want to do is have a popup, either a pop-up in some JS(?) or a new small window with results of clicking the button.
I’ve looked into the AUI, but I don’t really understand it.
Also, I tried importing the Template Renderer and referencing a .vm file that could execute some HTML. But when I add the dependency:

<dependency>
    <groupId>com.atlassian.templaterenderer</groupId>
    <artifactId>atlassian-template-renderer-api</artifactId>
    <version>3.0.0</version>
    <scope>provided</scope>
</dependency>

IntelliJ Idea 2017 throws an the dependency can’t be found. However, I have the latest dependency from here.

If I was vague or not conveying the message correctly, please let me know I’ll update the post.

Thanks in advance.
Cheers

I’m pretty new to the JIRA add-on development scene but when I’ve had issues with a dependency not loading, I’ve usually found its a version issue - I’m loading the template render too and I’m using version 2.0.4 (along with Jira version 7.2.1).
As for the popup, I use the AUI Dialog2 - here’s the start of a snippet in my .vm file:

<section role="dialog" id="event-dialog" class="aui-layer aui-dialog2 aui-dialog2-small" aria-hidden="true">            
        <header class="aui-dialog2-header">

And then in my javascript I would show it with this:

AJS.dialog2("#event-dialog").show();

And close functions on the buttons on the dialog itself like this:

AJS.$("#dialog-close-button").click(function(e){
		e.preventDefault();
		AJS.dialog2("#event-dialog").hide();
	});
    
    AJS.$(".aui-dialog2-header-close").click(function(e){
		e.preventDefault();
		AJS.dialog2("#event-dialog").hide();
	});

Hope this helps.

1 Like

Hi guys.

I’m trying to do the same, but using a webwork. I created a web-item and a webwork and, for now I only could open the popup using , in the web-item, the tag with the value trigger-dialog.
I already look in many posts, but until now I couldn’t find any response in how to use a AJS.$ Dialog 2 from a issue action menu.
Anymore can help on this?. Maybe a Jira AUI expert ;)? Anyone, has a tutorial for that?

Regards,

1 Like