Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to open Dialog Window when Web Item is clicked?

Tanner Reese June 25, 2018

As far as I can tell web items are used for linking to URLs. How might you connect the click event of the web item to a dialog menu like the ones for Create Issue and Create Project? I have seen JavaScript used for this purpose, but I'm not sure how one attaches this js to the web item.

1 answer

0 votes
Alexey Matveev
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.
June 25, 2018

Hello,

You should add your java script on page loading and wait until your web item is on the page. After it you can define a click event for your item. You can have a look at a similar question:

https://community.atlassian.com/t5/Jira-questions/How-to-add-web-item-via-scriptrunner-so-that-link-opens-in-new/qaq-p/821310#M267152

Tanner Reese June 25, 2018

But what JavaScript code do you write to have a create project dialog popup?

Alexey Matveev
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.
June 25, 2018
Tanner Reese June 26, 2018

But how do you connect the html and js to the plugin?

P.S. The link you provided is deprecated and the up to date one is here https://docs.atlassian.com/aui/7.7.3/docs/dialog2.html

Alexey Matveev
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.
June 26, 2018

You should use the web-resource tag in the atlassian-plugin.xml

https://developer.atlassian.com/server/framework/atlassian-sdk/adding-resources-to-your-project/

Suggest an answer

Log in or Sign up to answer