Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 28, 2021 • edited

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
AUG Leaders

Atlassian Community Events