Change Field's Requiredness and Visibility - ITSM


Set up a behaviour that changes the visibility of a field depending on the priority of an issue.

  • Navigate to Add-ons > Behaviours, using the Administration Cog in the top right corner.
  • Under Add Behaviour, enter a Name and Description.
  • Click Add.
  • Click on the Fields option for the newly created behaviour. Add the behaviour to the Priority field by choosing it from the drop-down list and clicking Add.
  • Select Add Server-Side Script.
  • The inline script should appear, paste this code snippet into it.


Detailed use case example: Adding Behaviours to The Customer Portal


Jira Jira (7.5 - 7.13)

import com.atlassian.jira.issue.priority.Priority
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript

@BaseScript FieldBehaviours fieldBehaviours

def priorityField = getFieldById(fieldChanged)
def customField = getFieldByName("Number Field")
def priorityValue = priorityField.value as Priority == "Highest" ?
    customField.setRequired(true).setHidden(false) :

Discovered an issue? Report it here

Suggested for you

Appears in these Collections