Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,523
Community Members
 
Community Events
185
Community Groups

I need to display the difference between two dates as number of years. How to do this using JWT?

I would like to use this in the post function of my service desk workflow, to update a numeric field based on the two mandatory date fields that have value. Start date and End date are available. The requirement is to populate the numeric field - "Duration in years"

2 answers

1 accepted

3 votes
Answer accepted

Hi @Thorsten Letschert _Decadis AG_ ,

I used the following formula based on your suggestion. It worked as expected. Thank you!

round(({00012}-{11604})/{YEAR})

{00012} is the system date-field "Due Date" and {11604} is a custom date-field "Start Date"

1 vote
Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 15, 2023

Hi @Gunasekaran N ,

Assuming that you want to calculate the date difference between those two fields in years, you can try an expression like

({issue.cfEEEEE} - {issue.cfSSSSS}) / {YEAR}

where EEEEEE is the ID of your End date and SSSSS is the ID of your Start date. Add those two using the field picker, and make sure you're using the numeric value without the '%'.

Cheers,
Thorsten

This was giving syntax error!

The post function that I am using is:

Update parameters of the Mathematical or date-time expression calculator Function for this transition.

However your reply gave me a clue. Thank you

Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 15, 2023

Hi @Gunasekaran N ,

Thanks for your feedback. Could you please accept my answer then?

Cheers,
Thorsten

Suggest an answer

Log in or Sign up to answer