Hello Community,
I’m using Jira Server and need assistance with dynamically showing or hiding a custom field based on the value of the Epic Link field. Here's the scenario:
- I have a custom field, Field A (ID:
20841), and the Epic Link field (ID: 11440).
Requirement:
- If the Epic Link is empty (i.e., the Task is not linked to any Epic), Field A should be visible.
- If the Epic Link is not empty (i.e., the Task is linked to an Epic), Field A should be hidden.
This behavior needs to work on both the Edit screen and the View screen.
I used the following ScriptRunner Behaviour:
def fieldA = getFieldById("customfield_20841")
def epicLink = getFieldById("customfield_11440")
def epicLinkValue = epicLink.getValue()
if (epicLinkValue) {
fieldA.setHidden(true)
} else {
fieldA.setHidden(false)
}This script works perfectly on the Edit screen, but it does not affect the View screen.
Any guidance or suggestions would be greatly appreciated!