Hi, We need to display a multi-line text filed based on a value selected in select custom field in Jira. I have following code using scriptRunner Script field.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.resolution.Resolution
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()
/* Get the custom field names for select and text fields*/
def complianceReviewNotRequiredField = customFieldManager.getCustomFieldObjectByName("Compliance Review not required")
def complianceReviewField = customFieldManager.getCustomFieldObjectByName("Compliance Requirement")
/* check the custom select value is selected as Approval Not Needed*/
def selectedOption = complianceReviewField.getValue(issue).toString()
def isOtherSelected = selectedOption == "Approval Not Needed"
if(selectedOption == "Approval Not Needed"){
complianceReviewNotRequiredField.setHidden(false)
complianceReviewNotRequiredField.setRequired(true)
}
Hi Akbar,
Thank you for your question.
I can confirm that it is not possible to dynamically restrict, hide or show fields using ScriptRunner for Jira Cloud like you can do with ScriptRunner for Jira Server using the Behaviours module which the server version provides. You can see a full list of the differences between the two versions here.
This means that we are currently unable to provide the Behaviours functionality in JIRA cloud to dynamically restrict fields due to the fact that the API and functionality which Atlassian provide in JIRA Cloud is much more restricted than the API which they provide in JIRA Server.
If this response has answered your question can you please mark it as accepted so that other users searching for a similar question can see that this is a correct answer.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.