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

0 votes
Answer accepted
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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""")

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events