You can do this with the following behaviours script attached to the "Epic-QC" field:
import com.onresolve.jira.groovy.user.FieldBehaviours import groovy.transform.BaseScript @BaseScript FieldBehaviours fieldBehaviours def epicField = getFieldById(getFieldChanged()) def detailedListField = getFieldByName("Detailed Functionality List") def epicValue = epicField.getValue() if (epicValue) { detailedListField.setFieldOptions([(epicValue): epicValue]) } else { detailedListField.setFieldOptions(["-1": "None"]) }
It will set whatever value is in the "Epic-QC" field into the "Detailed Functionality List" field. If no value is set the value in the list will be None.
Dear @Adam Markham [Adaptavist],
Thank you so much for your response.
I tried your above behaviours script and it is populating "Epic-QC" field value into "Detailed functionality list" but when i click on update i got the error .Please refer the below attachment for the same.
Also When "Epic-QC" field value get populate into "Detailed functionality list" then it should not remove the previous drop-down option values.
epic_qc_to_dfl.jpg
Thanks and Regards,
Suchit R Kharatmol.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Those numbers next to the values are the option ids, you need to match it with the corresponding one, So for suchit your code needs to be:
import com.onresolve.jira.groovy.user.FieldBehaviours import groovy.transform.BaseScript @BaseScript FieldBehaviours fieldBehaviours def epicField = getFieldById(getFieldChanged()) def detailedListField = getFieldByName("Detailed Functionality List") def epicValue = epicField.getValue() if (epicValue) { detailedListField.setFieldOptions(["11400": epicValue]) } else { detailedListField.setFieldOptions(["-1": "None"]) }
I did not see error myself when testing this. Have you another behaviour enabled for this field or another validator?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @Adam Markham [Adaptavist],
Thank you so much for your response.
I tried your above behaviours script and it is populating "Epic-QC" field value into "Detailed functionality list". Its working fine now without any errors.
Thanks a lot for your help Adam.
Thanks and Regards,
Suchit R Kharatmol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great, glad you got it working. If you want the other options you need to specify them like so in the setFieldOptions call.
detailedListField.setFieldOptions(["11400": epicValue, "11313": "demo"])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Adam Markham [Adaptavist] ,
Thank for your response.
Yes Detailed functionality list is the single list select list custom field. I want to populate "Epic-QC" value in the Detailed functionality list single list field .
Thanks and Regards,
Suchit R Kharatmol.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this a single select list? Do you want to populate the list with values in "Epic-QC" or select one in the list based on "Epic-QC" value?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamie Echlin [Adaptavist],
Thank for your response.
I tried the below behavior script.
FormField epic=getFieldByName("Epic-QC"); String epic_value=epic.getValue(); log.error("----------- Epic-QC value is---"+epic_value) FormField dfl=getFieldByName("Detailed Functionality List").setFormValue(epic_value);
Thanks and Regards,
Suchit R Kharatmol.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What have you tried so far?
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.