For example, I have custom filed A with values 1,2,3
custom field B with values 4,5,6
custom filed c with values x,y,z, !,@,#. 11,13,15
If I select custom filed value A as 1 and custom field value of B as 4 then custom field C should display following values x,y,z
I'm using script runner plugin, with following behavior, but no luck
import groovy.transform.BaseScript
import com.atlassian.jira.issue.customfields.option.Option
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.component.ComponentAccessor
def A=getFieldByName("A")
def B=getFieldByName("B")
def C=getFieldByName("C")
if(A.getValue() == "1" && B.getValue().equals("4")
{
C.setFormValue(optionFor(C, "x", "y", "z").optionId)
}
else if(A.getValue() == "2" && B.getValue().equals("5")
{
C.setFormValue(optionFor(C, "!", "@", "#").optionId)
}
@Maheshbatta , Shouldnt you be using formField.setFieldOptions(Iterable) instead of setFormValue on C?
@Fazila Ashraf , Thanks for your reply, tried it but no luck
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.