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

This widget could not be displayed.

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
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

241 views 1 3
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