Link to tabN in Edit Issue

Deleted user January 4, 2019

Hello,

I'm working on setting up some automated processes to allow users to work easily with our workflow, and one of these requests was an email that directs the user to approve or deny an issue at a certain point of the process. The easiest way I figured to do this was to do this was to make a tab in the Edit Issue dialogue for approvals.

I know I can link directly to an issue's edit page with https://<workspace>/secure/EditIssue!default.jspa?=xxxxx as the URL to a hyperlink, but I want them to go directly to the new tab. I checked the URL associated with the tab itself and it appears to simply append #tab2 to the URL. However, when I put this into a browser, I am still greeted with the primary tab.

How can I link directly to the second tab?

1 answer

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 7, 2019

Hi Daniel,

To Programmatically changes the active tab you would need to trigger a javascript injection on "AJS.tabs.change(tab, e);", as described here, however this is only available in a Jira Server Deployment, as Javascript and HTML injection is blocked on the Cloud platform due to XSS vulnerabilities that are opened up by the nature of a cloud platform as described in the Functional differences in Jira Cloud products documentation.

So on Cloud the default Tab will be the only landing point configurable as a server side option is not available to prevent the vulnerability this allows.  An alternative is to use a third party client side tool such as Tampermonkey or Custom Style Script, that can be used to inject a custom javascript locally from the browser side to modify the action or layout on page load to trigger a secondary tab as primary.  But this option will require a bit of testing the script customizations and some additional overhead as all the client users that this action needs to be triggered for will also need to have the add-on installed locally and configured with a functional script to initiate the java trigger.

Regards,
Earl

Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 9, 2019

Hey Daniel,

I did a little bit of playing around for a script on this for you and the following does the trick to trigger the second tab from direct edit issue page link, Noting "tab2" is the name of the second tab:

document.addEventListener("DOMContentLoaded", function(event) { 
  AJS.toInit(function(){
 AJS.tabs.change(jQuery('a[href="#tab2"]'));
});
});

Regards,
Earl

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events