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

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

Accepted Answer
1 vote

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.$);

Thanks @Domenico ManzoIts working :)

@Domenico Manzo 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
Community showcase
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

421 views 7 5
Join discussion

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