I'm using Jira Cloud and Advanced Roadmaps. I have the Team field set up and I use it to filter work items and display them on boards. We have two teams working in a single Jira project.
I want to use Scriptrunner Behaviours to show/hide various fields when the Team field has a specific team selected. So far, I can show/hide fields with a change to any field EXCEPT the Team field. I'm doing this to show or hide a field successfully:
logger.info('Debugging : Script for behaviour Team Change is running');
const ticketIMXField = getFieldById('customfield_12335');
const teamField = getFieldById('customfield_12405');
{
switch (teamField.getValue().value) {
case 'Front of House':
ticketIMXField.setVisible(false);
break;
case 'QA Team':
ticketIMXField.setVisible(true);
}logger.info(teamField.getName())
logger.info(teamField.getValue().value)
}When I try to use the Team field in line in place of 'customfield_12405', I get errors like this:

Looking at the field in the Jira API, I see it has a type of 'team'. I'm not sure what to try next to solve this issue.