Forums

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

How to get url currently displayed on browser

Masocha Masocha October 21, 2013

4 answers

0 votes
Masocha Masocha October 23, 2013

With Javasacript l can only problem is will this work when for example l want the content as PDF because l need to use the current displayed URL in a condition in a user macro

0 votes
Matthew J. Horn
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 21, 2013

Where? In a user macro? In a macro or plugin? In JavaScript on the page?

0 votes
RambanamP
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 21, 2013

you can get using javascript

var pathname = window.location.pathname;

check this

http://stackoverflow.com/questions/406192/how-to-get-the-current-url-in-javascript

Masocha Masocha October 23, 2013

With Javasacript l can only problem is will this work when for example l want the content as PDF because l need to use the current displayed URL in a condition in a user macro

0 votes
Andrey Markelov
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 21, 2013

For JIRA sometimes (from Custom Field, Tabs, ect) you can use:

public static String getBaseUrl() {

    HttpServletRequest req = JiraWebUtils.getHttpRequest();

    return req.getScheme().concat("://").concat(req.getServerName()).concat(":").concat(Integer.toString(req.getServerPort())).concat(req.getContextPath()); }

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events