Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Text field to be displayed based on single choice select list value

Hi, 

I am facing a major issue with this script applied in the behaviours.. .

followed steps: Validator plugin On and given the workflow

In the initialiser and server end added the same script.

Given the mapping correctly.

But still unable to achieve the output.

 

Need your help!!! 

 

Select single list field name : Return Adds Media
Drop down values : None, Tran 119, Media, Reverse
Text field: 3 digit Black Customer Code

For Return Adds Media field if we select value "Tran 119" it should display the text field "3 digit Black Customer Code" in the screen.
If we select None or Media or Reverse the text field should be hidden.

 

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.ComponentManager

import com.atlassian.jira.issue.fields.customField

import com.atlassian.jira.issue.IssueManager

import com.atlassian.jira.issue.MutableIssue

import com.atlassian.jira.issue.ModifiedValue

import com.atlassian.jira.issue.customfields.manager.OptionsManager

import com.atlassian.jira.issue.fields.config.fieldConfig

 

import com.onresolve.jira.groovy.user.FieldBehaviours

import com.onresolve.jira.groovy.user.FormField

import com.atlassian.jira.component.ComponentAccessor

 

FormField RAM = getFeildbyId ("customfield_11413") // id for RAM

FormField dBCC = getFeildbyId ("customfield_15703") // id for dBCC

 

String RAMchoice = (String) RAM.getValue()

//if (RAMchoice == "Tran 119")  { // this is the RAM choice value

if (RAMchoice.contains("11610")) { // this is the RAM choice value

//FormField dBCC = getFieldBYID("customfield_15703") // id for dBCC

dBCC.setHidden(false)

dBCC.setRequired(true)

}

else {

 dBCC.setHidden(true)

}

 

 

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Opsgenie

Investigate deployment-related incidents with Bamboo and Opsgenie together

Back in April of last year one of the major product announcements from Opsgenie was the launch of the Incident investigation view which created a deep connection between Bitbucket and Opsgenie, empow...

150 views 1 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you