Forums

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

any mistake with this behaviour

Surender Reddy July 2, 2019

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 

 

 

 

2 answers

0 votes
Surender Reddy July 8, 2019

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  

Antoine Berry
Community Champion
July 9, 2019

Hi,

Yes you can use multiple behaviours on one screen. You should check the atlassian-jira.log file. 

0 votes
Antoine Berry
Community Champion
July 3, 2019

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events