Versions Compared

Key

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


Page properties
hiddentrue
Status
Tech review

Status
colourGreen
titledone

Style guide

Status
colourGreen
titledone

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

Page properties
hiddentrue
Short descriptionThis function adds or substracts natural days (or working days) to/from any given date. Weekends will not be counted as working days.Output

Status
subtletrue
titlenumber

Available since

Status
subtletrue
colourBlue
title2.3.3

UI Text Box
sizemedium
typeinfo

This function adds or substracts natural subtracts days ( to or working days) to/ from any given date.

Weekends will not be counted as working days.


Code Block
languagebash
titleSyntax
linenumberstrue
addDaysSkippingWeekendsaddDays(timestamp, numberOfDays, timeZone) #Output: Number


UI Expand
titleExamples


Parser expressionDescription


Code Block
linenumberstrue
addDaysSkippingWeekendsaddDays({issue.duedatedueDate}, 2, LOCAL)


This function example adds 2 working days to the 

Status
subtletrue
titleTimestamp
 of the issue the issue's due date. 

  • If the due date is set to a Monday the function will return a date-time for Wednesday .
  • If the due date is set to a Friday the function will return a date-time for Tuesday.


    Code Block
    linenumberstrue
    addDaysSkippingWeekendsaddDays({issue.duedatedueDate}, -2, LOCAL)


    This function substracts example subtracts 2 working days from the 

    Status
    subtletrue
    titleTimestamp
     of the issue due date.

  • If the due date is set to a Monday the function will return a date-time for Thursday.
  • If the due date is set to a Friday the function will return a date-time for Wednesday

    the issue's due date.


    Code Block
    linenumberstrue
    addDaysSkippingWeekendsaddDays({issue.cf10100}, -6, USER_LOCAL)


    This function substracts example subtracts 6 working days from the 

    Status
    subtletrue
    titleTimestamp
     of a days from a custom date-time field (with the ID 10100).

    Instead of the Jira server's local time, this example uses the current user's time zone.



    Work days might depend on the time zone - it might be Sunday on the west coast of the US while at the same time it's already Monday in Australia
    UI Expand
    titleAdditional information

    Parameters used in this function

    ParameterInput (data type)Description
    timestamp

    Status
    subtletrue
    titlenumber

    The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date).

    numberOfDays


    Status
    subtletrue
    titlenumber

    The number defined here will be the offset in days. Negative values are used to substract subtract days.

    Internally JWT multiplies this value with the time macro {DAY} to add full days to the timestamp. Learn more about time macros.

    timeZone

    Status
    subtletrue
    titletimezone

    The time zone used for the calculation

    UI Text Box
    typetip



    UI Expand
    titleOutput

    This function returns a 

    Status
    subtletrue
    titlenumber
     representing a timestamp.

    UI Text Box
    typetip

    The output can be written into any Jira field of type Date Picker ore or Date Time Picker.

    Another very common use case is to use this function in one of the JWT calculated date-time fields.

    UI Text Box
    sizemedium
    typeinfo

    Variant of the function where you can define the start and the end of the  weekend .

    This function is useful when the non-working days differ from the standard (Saturday/Sunday).




    Image AddedUse cases and examples

    Page properties report
    firstcolumnUse case
    headingsJWT feature, Workflow function, Field type, Automated action, Parser functions
    cqllabel = "parser_func_adddays" and space = currentSpace()


    Page properties
    hiddentrue



    Status
    Tech review

    Status
    colourGreen
    titledone

    Style guide

    Status
    colourGreen
    titledone

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



    Page properties
    hiddentrue
    id1


    Parser function cloudaddDays()
    Map(tick)
    Notes




    Page properties
    hiddentrue


    Short descriptionAdds or subtracts days to or from any given date.
    Output
    Code Block
    languagebash
    titleSyntax
    linenumberstrue
    addDaysSkippingWeekends(timestamp, numberOfDays, timeZone, startOfWeekend, endOfWeekend) #Output: Number
    UI Expand
    titleExamples
    Parser expressionDescription
    Code Block
    linenumberstrue
    addDaysSkippingWeekends({issue.duedate}, 10, LOCAL, {FRIDAY}, {SATURDAY})

    This function adds 10 working days to the 

    Status
    subtletrue
    titleTimestamp
     of the issue due date.

    Fridays and Saturdays are not counted.

    Code Block
    linenumberstrue
    addDaysSkippingWeekends({issue.duedate}, -2, LOCAL, {SUNDAY}, {TUESDAY})

    This function substracts 2 working days to the 

    Status
    subtletrue
    titleTimestamp
     of the issue due date.

    Sundays, Mondays and Tuesdays are not counted.

    UI Expand
    titleAdditional information

    Parameters used in this function

    ParameterInput (data type)Descriptiontimestamp

    Status
    subtletrue
    titlenumber

    The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date).numberOfDays

    Status
    subtletrue
    titlenumber

    The number defined here will be the offset in days. 

    Negative values are used to substract days.

    Internally JWT multiplies this value with the time macro  {DAY} to add full days to the timestamp. Learn more about time macros.

    timeZone Statussubtletruetitletimezone

    The time zone used for the calculation. 

    startOfWeekend

    Status
    subtletrue
    titlenumber

    The parameter will take values in the format of  {MONDAY},{TUESDAY}...{SUNDAY} endOfWeekend

    Status
    subtletrue
    titlenumber

    The parameter will take values in the format of  {MONDAY},{TUESDAY}...{SUNDAY}
    UI Text Box
    typetip

    Work days might depend on the time zone - it might be Sunday on the west coast of the US while at the same time it's already Monday in Australia. 

    UI Expand
    titleOutput
    This function returns a 
    Available since

    Status
    subtletrue

    title

    colour

    number representing a timestamp. UI Text Box
    typetip

    The output can be written into any Jira field of type Date Picker ore Date Time Picker.

    Red
    titleneeds lookup

    Label
    Another very common use case is to use this function in a JWT calculated date-time fields.