I have writeen a code for the requirement -I would like to display CustomField only when i pick a specific resolution value.
Code:
import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION
def resolutionField = getFieldById(RESOLUTION)
def TestField = getFieldById("customfield_30200")
if (resolutionField.getValue().toString().equals('Fixed'))
TestField.setHidden(false)
} else
{ TestField.setHidden(true) }
But it The field is not getting affected by any value change while transition .
It is always going directly to else loop not taking the selected value from resolution field .
Please have a look into it .
Hi @Priti Sonar
Try this one:
import com.atlassian.jira.issue.resolution.Resolution
def resolutionField = getFieldById("resolution")
def TestField = getFieldById("customfield_30200")
def resolution = resolutionField.getValue() as Resolution
if (resolution.name.equals('Fixed')){
TestField.setHidden(false)
} else{
TestField.setHidden(true)
}
There is a sample in this link.
You can also temporarily use .setHelpText() to see the variable in the screen.
Ex: resolutionField.setHelpText(resolution) etc.
Hi @Tansu Akdeniz ,
Tried your code , unfortunately still the same situation .
Here fixed is the Default value of Resolution field
TestField is visible (nevertheless which value is being selected in the resolution dropdown)
I m using behavior to fulfill this requirement and written the code like this :
have a look to the screenshot .
I m not sure if i m doing somewhere wrong should i need to put the code in initializer section or something else
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.