Combine two fields with Misc custom field

I followed the documentation to the latter trying to get two values of customfileds to combine it to one and I couldnt see the resulting field on the screen.

Here is the formula I used:  - ( an exact copy form the documentation, just changed the filed numbers to suit )

<!-- @@Formula: (issue.get("customfield_10111") != null ? issue.get("customfield_10111") : 0) + (issue.get("customfield_10115") != null ? issue.get("customfield_10115") : 0) --> 


 It states in the documentation that I should look thru the (atlassian-jira.log) - logfile, which I did, and it states in there:

secure/QuickEditIssue!default.jspa [innovalog.jmcf.fields.CalculatedTextField] CalculatedTextField: error evaluating formula of field "PIR Number" of issue PIR-23:
Parse error at line 2, column 41. Encountered: return

The "PIR Number" is defined a "Calculated Text Field" .

So I thought to better start a bit simpler and tried to just get a single value, the "Summary", to display and that failed as well.

Here is what I use:

<!-- @@Formula: issue.get("summary") -->

And nothing is displayed on the screen - so I look again in the logfile but there is no entry for any errors!


Thanks for all suggestions

3 answers

The first error you listed wasn't generated by the formula you listed here - the formula has only one line and doesn't include a "return" statement, whereas the error points to a "return" statement on line 2.

Then the formula you used deals with numbers, and what you're trying to do is concatenate two text fields (I supposed) into one Calculated Text Field (not Number). So you should replace the zeros with empty strings ( "" ).

Then you should also make sure the two source fields are indeed Text fields. If they are Select fields (for example), then you need to add ".getValue()" after the call to "get(...)".

Finally, the last example is correct. So if it doesn't work, you should make sure you included the formula in the description of the Calculated Field, not in the description of the Field Configuration (the error is easy to make).

The last piece here was exactly my mistake. Pasting in the field configuration description will not work, it has to be the description under 'Edit' not 'Configure'


Thank you for this!

This is the correct place. Did you make sure you included the calculated field in the View page? And did you look at the Issue itself, not the list of issues (which won't display the new field until you reindex)?

Oh, and you can look inside atlassian-jira.log for ERRORs (right after displaying the issue)

this is where I placed the formula   -  I figure that I want to have this working before I delve into the next adventure, combining two text fields, actually its a value from a dropdown as you said and the issue number, not sure how to get to the issue number either, yet.

- thanks for your fast response

I need some 25 points to answer any more questions - I dont know how to get these - I try here to answer some more questions - 

not sure what the view page is, but I included it on a screen - definately.
and yes I am looking at the issue itself.

thank you 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,097 views 4 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you