Initialiser
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()
// Get a pointer to my select list field
def TeamSelect = getFieldByName("Requester's Team")
// Get access to the required custom field and options managers
def customField = customFieldManager.getCustomFieldObject(TeamSelect.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
//Replace Team with explicit list to remove NONE choice
def optionsMap = options.findAll {
it.value in ["DEV - Data Services","DEV - Nova Team","DEV - Titan Team","DEV - VAN","DEV - CPS","DEV - Reporting","DEV - MCO","QA - DS/eHealth","QA - PPE/RPT","QA - Automation/MCO","Others"] // list of options you want to show
}.collectEntries {
[
(it.optionId.toString()): it.value
]
}
TeamSelect.setFieldOptions(optionsMap)
condition
def TeamField = getFieldById(getFieldChanged())
def selectedOption = TeamField.getValue() as String
def ContractingAgencyField = getFieldById("customfield_12400")
//Reporting Interface
if (selectedOption == "Others")
{
//Show Fields
ContractingAgencyField.setHidden(false)
ContractingAgencyField.setRequired(true)
}
else
{
//Hide Issue Specific Fields
ContractingAgencyField.setHidden(true)
}
The field ContractingAgencyField is not sowing what ever the option i Select in Requester's Team
this behavior is working for other projects its not for one project can you guys see any mistake here
Hey, I checked the configuration its set to the right project and right issue type. I enabled logs for behaviors but I cannot find any in Catalina.out logs . is there any other file to check logs. I have a doubt I am using multiple behaviors on one screen for different custom fields is it ok.@antoine
Hi,
Yes you can use multiple behaviours on one screen. You should check the atlassian-jira.log file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Surender Reddy ,
If this behaviour is working in other projects you might want to check its configuration to make sure it applies to the right project / issue type. Also you might want to check the logs.
Antoine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.