Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

preset a date on the date macro

Butch_Richards
Contributor
July 9, 2024

how can I preset a date on the date macro in confluence  to now.PlusBusinessdays(5)  this folows the syntax on the atlssian dcumentation but willnot set the date macro using filed definition rules for set date 

1 answer

2 votes
Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2024

Hi @Butch_Richards ,

Maybe we've got the idea wrong but if the requirement is to show a date on the Confluence page that is 5 days after the today date excluding weekends, we can suggest trying the app that we develop - Table Filter, Charts & Spreadsheets for Confluence.

Here is another Community question that shows how to count dates from the specific start date excluding weekends and here is a modified variant for your case:

Tue 5-1.png

SELECT *,
FORMATDATE(DATEADD(day,
T1.'Period' +
2 * FLOOR(T1.'Period' / 5) +
CASE
WHEN "today"::Date->getDay() = 0 THEN 1
WHEN "today"::Date->getDay() = 6 THEN 2
WHEN ("today"::Date->getDay()) + T1.'Period' % 5 > 5 THEN 2
ELSE 0
END,
"today"))
AS 'End Date'
FROM T1

Tue 5-2.png

The output of the macro may be modified to show the result as plain text as well:

Tue 5-3.png

Butch_Richards
Contributor
July 9, 2024

@Stiltsoft support  can I refer to it in JSON ?

Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2024

Not sure that I got the question - please can you elaborate more? Maybe you are talking about Jira smart values or smth? https://confluence.atlassian.com/automation/jira-smart-values-date-and-time-993924864.html

Our macros work with Confluence and are used to transform and calculate data in tables - so you'll be able to virtually show them as you need.

Suggest an answer

Log in or Sign up to answer