How to display scripted or calculated field when creating an issue?

I tried to create an issue which contain filed as per following:

Summary:

Price1:

Price2:

Total price: Price1+Price2

 

I used the Scripted field for the Total price, but the field didn't display on screen when creating an issue. I also put the script on the create transition description as per this link suggest (https://gist.github.com/jechlin/5380119) but it didn't work. Please kindly suggest.

 

Thank you,

Nan

3 answers

1 votes

You don't.

Scripted fields are data that results from a calculation based on existing data.  On the create screen Price1 and Price2 are not set, so the script cannot do anything with them.  It can only create the data as the issue is created -  after the user commits the creation data.

The other point about scripted fields is that even when they have data, they do not appear on edit or transition screens because their data is not editable.  You can get them to display on these using javascript if you're a bit sneaky -  the script you've found should do it for some versions of JIRA, but as it's 3 years old, it will probably need a rewrite for more recent versions

1 votes

In addition to what the two other answers already say, you can use Behaviours for dynamically displaying a field value based on other field values: https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html

First of all you have to get field displayed on the screen. Check why it is not displayed using the instructions from this post : http://blogs.atlassian.com/2013/04/jira-admins-where-is-your-field/

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,103 views 13 19
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
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