Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page properties
hiddentrue


Tech review

Status
colourYellow
titleReady for review

Style guide

Status
colourYellow
titleReady for review

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged


Page properties
hiddentrue


Field typeJWT calculated date-time number fields
Use case descriptionCalculates the time left before the issue is due.
Complexity

Status
colourYellow
titleintermediate




Panel

On this page

Table of Contents
exclude(On this page|Use case).*
stylecircle
typeflat
separatorpipe



UI Text Box
sizemedium
typeinfo

Use case

This calculated field returns the time left before an issue is due, if a due date has been set.


Configuration

UI Steps


UI Step

Create a new Calculated Number Field (by JWT) custom field and name it properly.

UI Text Box
typetip

Providing a description will help you to identify what the custom field does but this step is optional



UI Step

Parser expression

Add the following expression:

Code Block
languagebash
titleMath expression for Calculated number field:
linenumberstrue
{issue.dueDate} != null ? max({issue.dueDate} - {system.currentDateTime}, 0) : null 


Expand
titlemore info...


UI Text Box
typeinfo

To achieve this, the following functions are used:

  • Conditional operator
  • max() is used to avoid returning a negative duration when the Due date has passed.




UI Step

Display format

UI Steps


UI Step

Choose Duration as Content type


UI Step

Choose Short as Duration display format

Expand
titlemore info...


UI Text Box
typeinfo

For this use case the format duration was chosen, since the numeric value being calculated, a number of milliseconds, represents a time duration.

This way the value is represented like 2d 9h 43m instead of a single number.





UI Step

Check the parameter Uninitialized when calculated value is zero

Expand
titlemore info...


UI Text Box
typeinfo

This parameter is set to stop calculation once the Due Date has been reached.





UI Step

Add the field to the relevant view screens.

UI Text Box
typenote

Remember: All calculated fields are read-only and cannot be manually updated on a create or edit screen.



UI Step

Once configured and added to an issue screen, the result will look like this:

Screenshot




Related use cases

Page properties report
firstcolumnUse case
headingsField type, Use case description, Complexity
sortByTitle
cqllabel = "calculated-field" and space = "JWTSDC" and ancestor = "27066672"


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue