Forums

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

Behaviours: Scriptrunner and Insight for JIRA

Shawn Danisa
May 8, 2018

I am doing field behaviors using scriptRunner and hit some sort of challenging problem.

The requirement is that when the user selected "VSC" from the drop down(insight object single select field), then other fields show appear.  But for some reason they don't show VSC is selected.  Please assist.

Below is the code:

def businessUnit = getFieldById("customfield_10622")


def selection = businessUnit.getValue()

def application = getFieldById("customfield_11001")
def serviceAffected = getFieldById("customfield_11002")
def applicationVersion = getFieldById("customfield_11008")
def customer = getFieldById("customfield_11007")

if(selection == "VSC")
{

application.setHidden(false) //show the fields
application.setRequired(true) //set the fields to be required
application.setHelpText("This field is required, please provide information") //Helptexts

def applicationSelection = application.getValue()

if((applicationSelection == "MYSILS") || (applicationSelection == "PPECB") || (applicationSelection == "MYEXCHANGE"))
{
customer.setHidden(false) //show the customer field
serviceAffected.setHidden(false) //show the services affected field

}
else
{
customer.setHidden(false) //show the customer field
serviceAffected.setHidden(false) //show the services Affected field
applicationVersion.setHidden(false) //show the Application version field
}

}else{

//hide the fields
application.setHidden(true)
serviceAffected.setHidden(true)
customer.setHidden(true)
applicationVersion.setHidden(true)


}

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Nic Brough -Adaptavist-
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.
March 24, 2021

Mmm, on Server, you can use whatever you want.  The "short" answer to this might actually be https://docs.atlassian.com/software/jira/docs/api/8.5.13/

TAGS
AUG Leaders

Atlassian Community Events