in my form i ask.
Is the issue related to specific components or process plans? - customfield_10689
Yes or No.
if Yes. make the following fields visible:
Process Plan Selection - customfield_10687
Work Order Number, Serial Number - customfield_10690
How much time in delays has this issue caused or would have caused?- customfield_10691
If No, then keep them invisible.
I have a Script runner for behaviours but i cant figure out how to code it at all.
please help.
If you are using SR for JIRA Cloud, then you can fit your goal installing Behaviours. You can read more about Behaviours Cloud here: https://docs.adaptavist.com/sr4jc/latest/features/behaviours
In the documentation you will be able to see one special function :
Yeah, i found documentation on it. but i cant change any fields visibility. this particaular field throws an error. but even other fields dont work. even with no errors.
is my code wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please, if my last response help you and you like it, could you accept my response ?
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This was a great help as it partially works.
for my multiselect field i get an error. (screen shot attached). i went around it by using another custom field and it works. so something about the multiselect field is not right.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Second issue. (skipping the problem with my custom field from my previous reply).
The field that needs to be visible/invisible now completely disapears when i change any field. and i cant bring it back.
Now, i am making a "title" field disappear based on the question. but like i said. it goes missing when i change any field in issue creation form.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So create a new behaviour, set it to the specific project and issue type, it will need to be a server side script triggered when the form loads.
We had script runner removed so cant test for you and you should test outside your production environment.
I did ask Chat GPT to clean my code as i always use to do.
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def processPlanField = customFieldManager.getCustomFieldObjectByName("Process Plan Selection")
def workOrderField = customFieldManager.getCustomFieldObjectByName("Work Order Number, Serial Number")
def delayField = customFieldManager.getCustomFieldObjectByName("How much time in delays has this issue caused or would have caused?")
def specificComponentsField = getFieldById("customfield_10689")
def processPlanSelectionField = getFieldById("customfield_10687")
def workOrderSerialField = getFieldById("customfield_10690")
def delayTimeField = getFieldById("customfield_10691")
def isRelatedToSpecificComponents = specificComponentsField.getValue() == "Yes"
processPlanSelectionField.setHidden(!isRelatedToSpecificComponents)
workOrderSerialField.setHidden(!isRelatedToSpecificComponents)
delayTimeField.setHidden(!isRelatedToSpecificComponents)
if (!isRelatedToSpecificComponents) {
processPlanSelectionField.setFormValue(null)
workOrderSerialField.setFormValue(null)
delayTimeField.setFormValue(null)
}
if (isRelatedToSpecificComponents) {
processPlanField.setHidden(true)
workOrderField.setHidden(true)
delayField.setHidden(true)
} else {
processPlanField.setHidden(false)
workOrderField.setHidden(false)
delayField.setHidden(false)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.