I was trying below is giving me an error on setForm
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def vrm = customFieldManager.getCustomFieldObject("customfield_14704")
def version = customFieldManager.getCustomFieldObject("customfield_14800")
def release = customFieldManager.getCustomFieldObject("customfield_14801")
def maintenance = customFieldManager.getCustomFieldObject("customfield_14802")
def versionval = issue.getCustomFieldValue(version) as double
def releaseval = issue.getCustomFieldValue(release) as double
def maintenanceval = issue.getCustomFieldValue(maintenance) as double
//def vrm = getFieldById("customfield_14803")
//def version = getFieldById("customfield_14800")
//def versionvalue = version.getValue() as double
//String s = version.concat("."+release).concat("."+maintenance)
//def x = issue.getCustomFieldValue(version) ++ issue.getCustomFieldValue(release)
//def y = versionval.concat("."+releaseval).concat("."+maintenanceval)
def y = versionval + "." + releaseval + "." + maintenanceval
if(versionval)
{
//version.setError("ghjghj")
vrm.setFormValue(y)
println(y)
}
Hi @Syed Muhammad Umair Mansoor
What type of custom field are you using for vrm? Is it a Number Field or a normal Text Field?
When you are using the + operator along with the " " in:-
def y = versionval + "." + releaseval + "." + maintenanceval
you are converting the value to a String. If you intend the value to be a String, then your approach appears to be fine.
Thank you and Kind Regards,
Ram
Thanks for reminding about it, actually I need to change the type of custom field and need to put as INT for custom field value retrieval.
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.