Hello Team,
I have two custom fields, the second field should pop up in create issue only if the value in first custom field matches certain text.
Is it possible to configure something like that ? Do suggest if anyone has done something like that.
Hi @Vishal ,
This is possible using an addon. I would advise ScriptRunner through its behaviours module. It is a very complete addon with great support. I can help with the code if needed.
Antoine
Hello Antoine,
That would be great help, I am trying it with behaviour only but couldn't get it done. If you can help with the code would be fantastic.
Vishal
Create a new behaviour and link it to the first field. Add a custom code :
import groovy.transform.BaseScriptimport com.onresolve.jira.groovy.user.FieldBehaviours@BaseScript FieldBehaviours fieldBehavioursint secondFieldId = 12800def secondField = getFieldById("customfield_" + secondFieldId)secondField.setHidden(true)//if underlyingIssue does not exist, it means we are in the issue creationif (!underlyingIssue){int firstFieldId = 12900def firstField = getFieldById("customfield_" + firstFieldId)def firstFieldValue = firstField.getValue()if (firstFieldValue.contains("123")){secondField.setHidden(false)}}
You have to adapt it with your field ids and requirements. Let me know if you need something more specific. Note that this code will only trigger when the focus is lost on the first field.
It looks like you're new here. Sign in or register to get started.