Versions Compared

Key

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

UI Text Box
sizemedium
typeinfo

Use case

Return the lowest date from a Date Picker custom field in the linked issues of the current issue.

Expression

Create and configure a Smart field using this expression in Jira expression mode:

ExpressionDescription

 parsing mode:


UI Text Box

Please, replace nnnnn with the ID of a Date Picker custom field.

Code Block
languagejs
linenumberstrue
%{ count(fieldValue({issue.cfnnnnn}, linkedIssues()))
let minDate = issue?.links.map(link => link.linkedIssue.customfield_nnnnn).filter( d => d != null);
minDate.length > 0 ? new 
dateToString( min( fieldValue({issue.cfnnnnn}, linkedIssues())), RUN_AS_LOCAL, RUN_AS_LANG) : null}

This example returns

3

To achieve this, the following functions are used:

CalendarDate(minDate.reduce((a, b) => a < b ? a : b )).toString() : ""
UI Text Box

Please, replace nnnnn with the ID of a Date Picker custom field.

  • count()
  • fieldValue()
  • linkedIssues()
  • dateToString()
  • min() 


    Page properties
    hiddentrue
    Feature

    Field type

    Smart text field

    Parsing mode

    General modeJira expression

    Expression
    Code Block
    languagejs
    linenumberstrue
    %{ count(fieldValue({issue.cfnnnnn}, linkedIssues()))let minDate = issue?.links.map(link => link.linkedIssue.customfield_nnnnn).filter( d => d != null);
    minDate.length > 0 ? new dateToString( min( fieldValue({issue.cfnnnnn}, linkedIssues())), RUN_AS_LOCAL, RUN_AS_LANG) : null}CalendarDate(minDate.reduce((a, b) => a < b ? a : b )).toString() : ""
    UI Text Box

    Please, replace nnnnn with the ID of a Date Picker custom field.

    Parser functions
    Label
    Use case description

    Return the lowest date from a Date Picker custom field in the linked issues of the current issue.

    Complexity

     

    Status
    titleINTERMEDIATE