Forums

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

Script Runner - Script Field

Ståle Rivelsrud January 30, 2018

I am trying as noob to create a script with Script Runner that make a custom web url..

- Creating a new Script Fielfd
- Template HTML
- Inline script is creating the correct web url BUT I am not able to click on the link.

def caseURL = baseURL + caseNumber
       return caseURL

Am I missing som tags to make it clickable? 
And how to make the link open in a new browser tab?

 

thnx in advance

1 answer

1 accepted

1 vote
Answer accepted
Jenna Davis
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.
January 31, 2018

Hello, 

You should have something like this for your script:

def link = "<a target='_blank' href='http://google.com'>Google</a>"
return link

 That will just create a link that opens the Google home page in a new tab. The "target='_blank'" portion will cause it to open in a new tab. You can add in your baseUrl and issue key to build the URL using ${baseUrl} or ${issue.key}.

This community question might help you out a bit also. 

If you need further help getting this to work, send me the code you have and I'll help you out from there. :)

Jenna

Ståle Rivelsrud January 31, 2018

Hi Jenna,

Thnx  .. that solved my problem

This line solved it :)
def link = "<a target='_blank' href='" + baseURL + caseNumber + "'>" + baseURL + caseNumber + "</a>"
return link

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events