You can modify field descriptions and red warning messages on-the-fly, possibly to reflect changes in requiredness. Example, on changing the priority to Blocker (or Highest in newer JIRA versions), the Description help text changes:

high pri

To do this you put a validator on for example, "Priority", with the following code:

def formField = getFieldById(getFieldChanged())
def descField = getFieldById("description")

def priority = formField.getValue()?.name
if (priority == "Highest") { // choose priority by name
    descField.setHelpText("Please explain why priority is Highest.")
    descField.setRequired(true)
} else {
    descField.clearHelpText()
    descField.setRequired(false)
}

Have questions? Visit the Atlassian Community to connect, share, and learn with other Atlassian users and experts, including Adaptavist staff.

Ask a question about ScriptRunner for JIRA, Bitbucket Server, or Confluence.

Want to learn more? Check out courses on Adaptavist Learn, an online platform to onboard and train new users for Atlassian solutions.