Create a calculated field showing a percentage

Hi all, I would appreciate it of someone could help me here. I'm completely new to JIRA and have no background as a user. I'm sure what I'm asking is actually fairly simple but I cant get it to work. 

Essentially I have two number fields and I want to create a third which shows a percentage of the two. So simply: 




I have attempted this using a calculated number field and some "script":

<!-- @@Formula: (issue.get("customFieldId=10427") &divide; issue.get("customFieldId=10007") : 0)–>


This has not worked and even if it had I'm not sure it would show a percentage anyway.


I understand I could use a scripted field which I have the add in to do but I don't know where to start with that.


Help much appreciated smile 


2 answers

0 votes

Hey there,

I recommend you to use the add-on JIRA Misc Custom Fields to achieve this. Please take a look on their documentation at the following link:


--Arthur Gonçalves

Hi Arthur, thanks for this. This is where I actually referenced to do the first attempt at the HTML in my original question. Can you see anything wrong with what I had attempted because its not returning any values: <!-- @@Formula: (issue.get("customFieldId=10427") &divide; issue.get("customFieldId=10007") : 0)–>

try this: <!-- @@Formula: (issue.get("customfield_10427") != null ? issue.get("customfield_10427") : 0) / (issue.get("customfield_10007") != null ? issue.get("customfield_10007") : 0) -->

Hi Sy, that definitely gets values in the field so a step closed I'd say! Not a percentage though, will that have to be done through a scripted field as you have done below? I'll give that a shot

Have you tried using a scripted field? I use that for a lot of calculations, and setting it as a text would allow you to add the % symbol as well.

Its with the Script Runner Plugin:

Here you can set your custom fields but using getCustomFieldValue("Custom Field Name")

and then perform the calculations you want and then returning the answer, if you need the percentage sign you can set it to return as a text searcher have something like


return "% " + answer

Which would end up something like this that you can use:

//Retrieve two dates
w = getCustomFieldValue("Custom Field Name 1")
x = getCustomFieldValue("Custom Field Name 2")

//If Statement to check for nulls
if(w &amp;&amp; x != null){

//Calculating and saving answer
double answer = w/x as double

//displaying(returning) the answer
return answer
catch(Exception e)

If you'd like to do this through a post function then a post function is available called "Mathematical or date-time expression calculator " Through the plugin JIRA Workflow Toolbox, here you can calculate as well using different fields.

I'd like to add that the answer I've done is only dividing two fields which contain numbers, if you want to do a percentage calculation then e.g You may calculate something like double difference = w-x as double double division = difference/w as double double answer = division*100 as double return answer this for example will give you the difference between w and x in a percentage.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,547 views 15 21
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