Calculated text field

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

Try this

getCustomFieldValue("Your field name")

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 Behnke Community Champion Feb 25, 2016

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

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 Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

239 views 0 11
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot