How can I create a dialog box from a link in More section for issues screen in Jira7

Arun Sasikumar December 27, 2017

Hi,

I am working on a jira 7 plug-in to create a new web item in the More section of the issues screen. Upon clicking the web item- a new dialog box should appear and prompt the user to enter some details in a form.

I am able to create the new item in More list using web-section and web-item. Now I want to create a dialog box upon the user click. I wish to use Dialog2 here. Can anyone point me to a tutorial or sample code? 


PS: I am new to jira plugin development!


Thanks in advance!

1 answer

1 accepted

1 vote
Answer accepted
Domenico Manzo _Actonic_
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.
December 28, 2017

To add some popup dialog you should:

1. Add menu item in some dropdown menu https://developer.atlassian.com/server/jira/platform/adding-menu-items-to-jira/. But do not put any link:

<web-item key="website_link" name="Company Web Site" section="some_section" weight="10">
        <label>My link</label>
        <link linkId="website_link"/>
    </web-item>

2. Decide on which page will appear this menu with your link, to define proper "context".

3. Create new web-resource with proper context https://developer.atlassian.com/server/jira/platform/web-resource/

4. Add javascript file to the web-resource with "click handlers" and "dialog open" functions. Somethong like this:

(function ($) {
$(document).ready(function () {
// step 1. put dialog HTML at the and of <body> element
// step 2. set click handler to your web-item
// step 3. call AJS.dialog2().show();
});
})(AJS.$);
Arun Sasikumar December 29, 2017

Thanks @Domenico Manzo _Actonic_Its working :)

Arun Sasikumar January 1, 2018

@Domenico Manzo _Actonic_ This is working in issues view, but not in the issues search view. Have you faced anything like this before? Question - 696522#M227625. Thanks

Suggest an answer

Log in or Sign up to answer