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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published yesterday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

447 views 6 7
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