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

want to populate summary field with concatenation of three custom field values

I'm trying to use a groovy expression to populate the summary field from a postfunction.

I want to string together the values of three custom fields and have that be the issue's summary.

Starting with baby steps, I'm trying to set the summary field to just one of the custom field values.  No success.

I am NOT a groovy developer or any other kind of developer.  Which is defintely a problem since I'm not sure what a groovy expression is.

When I put for following in for a groovy expression I get the error shown below.

string issue.get("customfield_12230")

 /secure/QuickCreateIssue.jspa [jmwe.plugins.functions.SetFieldValueFunction] Error while executing SetFieldValueFunction: groovy.lang.MissingMethodException: No signature of method: Script1.string() is applicable for argument types: (java.lang.String) values: [Add] Possible solutions: toString(), toString(), print(java.lang.Object), sprintf(java.lang.String, [Ljava.lang.Object;), print(, sprintf(java.lang.String, java.lang.Object) groovy.lang.MissingMethodException: No signature of method: Script1.string() is applicable for argument types: (java.lang.String) values: [Add]

That's not bad considering that the value in the custom field is in fact "Add".  But obviously it didn't work.

When I drop "string" I get no errors in the logs, but neither does it populate the Summary field.

All help appreciated.  And if the answer can be in non-developer speak, even better!  smile




6 answers

1 accepted

0 votes
Answer accepted

A co-worker solved this for me.  The key is when the post-function is called.  

As I mentioned previously, This postfunction was the last post function run. It was after the postfunction that initially creates the issue.  We moved it to be the first postfuntion called and everything works!

Specifically in the value field I can put:





issue.get("customfield_12230") + " " + issue.get("customfield_12003")

And they all work.

I want to thank everyone for their time and suggestions.  I always start with Atlassian Answers because of all the smart people that are willing to offer their help.


One question, do you want to do that in a postfunction?

yes. On the create issue. In the creation of the issue, the reporter will fill in (required) values for three custom fields. I want to string those values together to populate the summary field. Seems like a postfunction is the way to go. Do you have a different suggestion?

0 votes

It looks like issue.get("customfield_12230") is returning an array, rather than a string.  Is the field a multi-select or checkbox field?

Another quick dirty test would be to try issue.get("customfield_12230").toString() and see what that returns - if it's an array, you'll get an ugly string like "[ armadillo ] @ [ banananana ] @ [ minion ]", but at least it will be telling you something.

That custom field is a radio button with two options. I can't even get this to work with "reporter" inserted instead of the custom field. Per your suggestion I tried issue.get("customfield_12230").toString(). No errors in the logs. But nothing put in the Description field either. I tried another custom field which is a user. Nothing. No errors. No results. I tried issue.get("reporter").toString() too. Nada. By the way, that is ALL I have in the Value window. I hope it's not assumed that I've included some other key phrase. I'll attach a screenshot.

Im not doing that using groovy, im using this postfunction:

of this Add-on:


In target field you use "Summary" and you can get values of any custom field available

On reason for my choice of groovy is that after I get this (what I thought would be) simple thing to work, I want to use groovy to call a perl script and take the results of that perl script and add it to a comment or other custom field. So I'm hoping to learn the groovy way in baby steps. I do appreicate your suggesting another solution however.

Guilherme, can you send some step by step to me so I can set this up?

FireShot Capture - Update Workflow Transition Set Field Va_ - https___jira.di2e.net_secure_admin_w.png

Hang on, that's different again. I'd go back to basics - does a plain fixed string work? E.g. just put in "Batman" or something obvious. Also, where did you get the " issue.get " type notation from?

I like basics. The only thing now in the Value box is "Batman". Didn't work. No errors. But the description field was not updated. I also tried leaving "Batman" and changing Value type to "Raw Value". Same results. This postfunction is the last post function run. It is after the postfunction that initially creates the issue and after the Issue Created event is fired. Thanks for your patience. Where I saw the issue.get notation:

Any suggestions? This just feels so basic. And yet . . .

Hmm. I'd say it's a bug in the JMWE then - putting in the string "Batman" should set the Summary to Batman. That's what the help and the documentation says - "return a string that will be converted", and "Batman" is exactly that. My only other thought is that maybe the JMWE expects an explicit "return", which feels wrong to me, as I thought it should just use the last evaluation or assert. So maybe try return "Batman"

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Jira Cloud for Google Sheets: Automatically Refresh Your Data!

Remember that time you realized it was possible to refresh your Jira data in Google sheets with just one click? What if we told you that you can now get the latest data with no clicks at all?! Zero! ...

266 views 3 9
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