The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to open url if we select an option in jira multiselect

Deleted user
April 24, 2019

Hello Team,

We are having below requirement,

There are two options in a single select custom field name A and B.
we have to open a URL in new tab if we select option "A",
and another URL if we select option "B"

The URL will be like a create issue screen in different project.

Please help us in providing any script for the above requirement.

Thanks & Regards,
Varun,

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
PD Sheehan
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 Champions.
April 24, 2019

I don't think it's possible to have a behavior script automatically open a new tab.

While behaviors actions are run on the client side with javascript, you can't have custom javascript action outside of those available from the API Quick Reference.

That said, I think your best bet might be to use the "setDescription" or "setHelpText" methods and put the URL you want your users to access below your single select.

Something like (not tested):

def selectFld = getFieldByName("your select field");
def url, project;
//don't remember if getValue() on select field returns an option or a string
//if(selectFld.value == "option A"){
if(selectFld.value.value == "option A"){

url = "http://urlA.com"
project = "projectAKey"
} else {
url = "http://urlB.com"
project = "projectBKey"
}

selectFld.setDescription("""Please <a href="$url" target="_blank">open this link</a> (new tab) to create an issue in $project""")
TAGS
AUG Leaders

Atlassian Community Events