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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create a new behaviour and link it to the first field. Add a custom code :
import groovy.transform.BaseScript
import com.onresolve.jira.groovy.user.FieldBehaviours
@BaseScript FieldBehaviours fieldBehaviours
int secondFieldId = 12800
def secondField = getFieldById("customfield_" + secondFieldId)
secondField.setHidden(true)
//if underlyingIssue does not exist, it means we are in the issue creation
if (!underlyingIssue){
int firstFieldId = 12900
def 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.