Repeat the first part of the guide for each value you want to use in your calculation.


Unable to render {include} The included page could not be found.

The MISC Custom Fields App is mandatory for this guide!

Create a new MISC numeric custom field

  1. Navigate to "Custom fields" section within the "Issue" settings
  2. Click on "Add custom field" at the top right
  3. Choose the "Calculated (scripted) Number Field (JMCF app)" field and give it a proper name
  4. Assign the field to all necessary screens

Configure the MISC field to calculate the difference

  1. Navigate to the "Custom fields" section in the "Issues" settings
  2. Search for the new field and click on the cog icon
  3. Choose the "Configure" option in the dropdown
  4. Click on "Edit Groovy Formular"
  5. Use the following script:

    (issue.get("customfield_10201")-issue.get("customfield_10300"))/60
  6. Click on the "Issue Fields" header and look for the recently created Scriptrunner fields in "Select a field" to find the custom field IDs
  7. Replace the example custom field IDs with the ones in your system
  8. Freely configure the script, depending on your needs

Edit the MISC field expression, so the value is shown in a time format

  1. Navigate to the "Custom fields" section in the "Issues" settings
  2. Search for the new field and click on the cog icon
  3. Choose the "Configure" option in the dropdown
  4. Click on "Edit Format Expression"
  5. Paste in the following script:

    if (value <= 60)
    return numberTool.format(value)+"m"
    else
    return numberTool.format(value/60)+"h"
  6. Navigate to any issue and look for the set up field