Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to pop up a new window for Web-item

Lei Han October 24, 2011

Hi,

I add a Web-item in issue page, and I expect when I click the button, a new window pops up, but until now, it doesn't work. My code looks like:

<web-item key="My key" name="web item name" section="operations-top-level">

<condition class="com.aa.condition">

</condition>

<label>my button</label>

<tooltip >This is my button</tooltip>

<link target="_blank">/spt/newReview.jspa?issueId=$issue.id</link>

</web-item>

It seems the 'target' attribute is invalid, so is there anyone know how to make a popup window for a web item?

Thanks a lot!

7 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

5 votes
Ł April 22, 2014

Conrad's method does not work for JIRA 6.2, but I've found another solution. Adding code below to web-item does the job.

&lt;param name="target" value="_blank" /&gt;

Alvin Gasta May 18, 2014

Is this working on jira 5.1? Can you post the code <web-item>code here</web-item>here where to place the one liner code above?

Ł May 18, 2014

Here is my full solution

&lt;web-item key="cool_link" name="Cool link"
	section="cool_links/cool_links_first_section"
	weight="10"&gt;
	&lt;label&gt;Cool link&lt;/label&gt;
	&lt;link linkId="atlassian_cool_link"&gt;http://atlassian.com&lt;/link&gt;
	&lt;param name="target" value="_blank" /&gt;
	&lt;condition
		class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition" /&gt;
&lt;/web-item&gt;

3 votes
sm shamim December 3, 2012

Inide your web-item add the following line,

&lt;styleClass&gt;aui-list-item-link issueaction-link-issue opsbar-operations&lt;/styleClass&gt;

You page should be displayed as a overlayed popup.



Vikash Kumar
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.
November 18, 2013

How to do the same for Confluence. I want a popup on click of some webitem.

1 vote
MatthewC
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.
September 25, 2012

You're right about target not being a valid attribute.

You can inject some javascript via the link href. It's not the prettiest but it seems to work for us. here's an example web-item link that opens a new window from a menu item.

&lt;web-item key="jira_doco_link" name="Jira Documentation Link" section="atlassian_down_menu/atlassian_jira_section"&gt;
        &lt;label&gt;Documentation&lt;/label&gt;
	&lt;link linkId="jira_doco_linkid"&gt;javascript:window.open('http://docs.atlassian.com/jira-latest/', 'atlassian_win').focus();&lt;/link&gt;
    &lt;/web-item&gt;

Akira Tsuchiya
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.
September 27, 2012

Matthew, I tried your 'javascript:window.open()' code in JIRA 5.1.5.

Unfortunately, it does not work.

MatthewC
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.
September 27, 2012

You didn't specify which version in your question so I had gave something generic. if I have time, I'll see what I can do next week. In the meantine, can you paste up the HTML snippet it generated?

Akira Tsuchiya
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.
September 28, 2012

Hello, Matther.

I found a solution with a few problems.

The code below works.

javascript:void(window.open('/secure/viewIssuePage.jspa?issueId=$issue.id&amp;issueKey=$issue.key','test','width=100, height=100'));

Your solution is right, but it seems not to work on several browsers.

The javascript is dependent on a browser type.

But my solution also has a problem. It pops up a child window on Firefox, but unexpectedly opens a new tab browser instance on IE.

I think a javascript-based solution is not a right answer to this question.

Lei and I want a CSS-based pop-up window like below, not a browser-based one.

Alvin Gasta May 14, 2014

Matthew Cobby's answer works on me. I'm using Jira version 6.2

Ł May 14, 2014

It didn't work for me due to characters escaping

Alvin Gasta May 18, 2014

Re you using jira 6.2 also? Can you paste here the code you are using taht has the character escaping?

0 votes
redcabin March 6, 2013

it's my question. i think it is good for adding tags for item'link .suppost?

0 votes
ConradR
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.
February 18, 2013

Instead of using JS you could add

" target="_blank

to your link in your xml:

&lt;link linkId="foo"&gt;http://my-link.com/bar.pdf" target="_blank&lt;/link&gt;

0 votes
grundic
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.
October 24, 2011

Hey, hey!

Take a look at this article: http://leonardinius.galeoconsulting.com/2011/01/howto-reusing-jira-gadgets-on-issue_10.html

There is js code, which can help you.

Have a nice day!

0 votes
Wojciech Seliga
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.
October 24, 2011

I don't think it's possible directly via a web-item. "target" attribute won't work.

They way how I worked around it is to use Javascript snipped (injected into view issue context) and JQuery to dynamically change the onclick behaviour on the link generated by the plugin framework from such web-item declaration.

You can also use AUI (namely its JIRA.FormDialog) to open standard JIRA popup (which grays out the entire screen).

Fee free to take a look at jira-view-issue-plugin (in source JIRA distribution) and add-attachments-link web-item there.

Sergey Tverdokhleb February 5, 2013

Can you briefly explain how to add AUI to open standart Jira Popup to a link? Can't get it, thanks.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events