Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I concatenate three custom field values and display it in fourth

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)
}

1 answer

1 accepted

1 vote
Answer accepted

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
Community showcase
Published in Apps & Integrations

Send an Email or Publish to Confluence - What should you do with your release notes?

Background When you hear the words ‘Release notes’, almost always you think of an unsolicited email from a software vendor. But I am here to tell you that from our data, sending release notes via E...

136 views 1 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you