Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I used the Behaviours function to simulate the secondary interactive drop-down menu
import com.atlassian.jira.component.ComponentAccessor;
def dutyCode = getFieldById(getFieldChanged())
def rootCauseCode = getFieldByName("Root Cause Code")
def dutyCodeValue = dutyCode.value as String
def queryValue = dutyCodeValue.split(' ')[0] as String
//convert text field to single select field
rootCauseCode.convertToSingleSelect([
ajaxOptions: [
url : getBaseUrl() + "/rest/scriptrunner/latest/custom/getRootCauseCodeByDutyCode?query=" + queryValue,
query: false,
formatResponse: "general"
]
])
//clean rootCauseCode value when options updated
rootCauseCode.setFormValue('') //this line don't work
How should I do? thanks!
Hi @lizong wei
What about move the clear value line before converting the text field?
//clean rootCauseCode value when options updated
rootCauseCode.setFormValue("")
//convert text field to single select field
rootCauseCode.convertToSingleSelect([
ajaxOptions: [
url : getBaseUrl() + "/rest/scriptrunner/latest/custom/getRootCauseCodeByDutyCode?query=" + queryValue,
query: false,
formatResponse: "general"
]
])
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.