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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Wednesday in Jira

Join our webinar: How 1B+ feature flag events helped us build the new Jira

Every time you release software, there's a bit of risk – that there's a bug, that something breaks, or that the feature doesn't resonate with customers. Feature flagging helps make high stakes s...

92 views 0 1
Join discussion

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