Forums

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

Jira URL hyperlinks in wiki style fields to open in a new tab

Aron Felberbaum
Contributor
August 30, 2019

Need assistance on how to use the announcement banner to open URL hyperlinks in wiki style fields in a new tab.

2 answers

1 accepted

0 votes
Answer accepted
Muhammad Ramzan_Atlassian Certified Master_
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.
August 30, 2019

you can use like this

 

<a href="https://www.google.com/" target="_blank">Open link in new tab</a>
Aron Felberbaum
Contributor
August 30, 2019

Thanks Muhammad,

What would be the code to add this logic in the Announcement Banner for all URL's in fields.

Muhammad Ramzan_Atlassian Certified Master_
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.
August 30, 2019

There is no logic required, Just add basic html tags for your requirements how you want to show the banner.

 

 

for example your banners is like this

 

Text line 1
<br>
Text line 2
<br>

Link1:  <a href="https://www.google.com/" target="_blank">Open link in new tab</a>
<br>
Link2: <a href="https://www.google.com/" target="_blank">Open link in new tab</a>

<br>

Text line4

1 vote
Aron Felberbaum
Contributor
September 2, 2019

The following did the job:

writer.write('''
<script>
window.setTimeout(function(){
AJS.$('a:not([target=_blank])[href^=http].attr('target', '_blank');
}, 500);
</script>
''')

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events