Hi,
We need to add a link in the operation bar of a JIRA issue. This is straightforward as documented
http://confluence.atlassian.com/display/JIRADEV/Web+Item+Plugin+Module
and it works :-)
Now, we would like to open up a new page (either as a new window, or as a new tab) when the user clicks the operation.
I've been searching the documentation, but I didn't see any good reference / example.
Any clues ?
Francis
Community moderators have prevented the ability to post new answers.
Hi,
I know this is the old post, but the solution may help others.
I came up with the alternate solution. We have installed Php on jira server instance (v7.5.1). I created a html page under jira_extend and specified that url of the page in the plugin this allows to me open the webitem link in new tab. Below is the code for html page
<html>
<head>
<script>
function loadInTab() {
url = "http://google.com";
window.open(url,'_blank');
history.back();
}
</script>
</head>
<body onload="loadInTab()"></body>
</html>
Make a HTML page with that - save it under /var/www/html/jira_extend/
lets say we called it openlink.php
so link in the webitem part definition would be http://jira.server/jira_extend/openlink.php
Hope this helps
Hi,
After taking a deeper look at the source code responsible for handling web items and building UI from that, I think that the documentation which Alexander references above uses unfortunate example which suggests that JIRA actually handles something called isPopupLink.
However in the source (viewissue-opsbar.jsp, com.atlassian.jira.plugin.webfragment.DefaultSimpleLinkManager) I see no reference whatsoever to such params. Moreover JIRA of of the box uses at leaast one web-item which opens a separate window - the one used for attaching screenshots (tiny applet allowing to paste images from clipboard). This single piece of functionality does not use isPopupLink either. Actually it has no params defined in XML, but instead uses extra javascript hacking (see ViewIssue.js) which overwrites standard <a> behaviour:
var openInNewWindow = function(e)
{
e.preventDefault();
e.stopPropagation();
var $this = jQuery(this);
// close the link
jQuery(document).click();
new JIRA.ScreenshotDialog({
trigger: $this
}).openWindow();
};
AJS.$("#attach-screenshot").click(openInNewWindow);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will certainly give it a go.
Thanks for the details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The closest i can see from the documentation is something like <param name="isPopupLink" value="true" />.
Normally you would force opening in a new window via <a href="#" target="_blank">. But i don't see, how to supply this to a web item.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.