Calculated text field

Simona Persico February 25, 2016

Hi all,

i'm trying to insert in the screen to create an issue a calculated text number.

I have two field:

  1. a select list with the following values: PRODUCTION, NO PRODUCTION
  2. a calculated text field in which I would like to set the details of the value selected in the previous field.

 

I've inserted this formula:

<!-- @@Formula:
if (issue.get("customfield_10401").equals("PRODUCTION"))
return "H.24";
else return "H.8"
-->

but it doesn't works...someone can help me to understand where I am wrong?

Thank you!

Simona

1 answer

1 accepted

4 votes
Answer accepted
Mohamad Khalife
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2016

Try this

getCustomFieldValue("Your field name")
Simona Persico February 25, 2016

Thank you! I've solved, saving first the value in a string 

<!-- @@Formula:
String choice= issue.get("customfield_12650");

if (choice.equals( "Production" )) return ""; 

-->

 

Now it works for issue that I've already created but inthe screen of create a new issue the field doesn't appear... but I have no reindexed... I don't know if is this the problem...

Thank you!

 

Steven F Behnke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2016

Calculated fields can only show up on the view screen, not the Create, Edit, or Transition screens.

Mohamad Khalife
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2016

Right, you should reindex since the value is calculated and stored in the index at the time that the issue is indexed, eg when it is modified or transitioned, or when you do a full reindex. 

Suggest an answer

Log in or Sign up to answer