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,466,618
Community Members
 
Community Events
176
Community Groups

Calculating using 2 custom fields (date time)

Edited
Deleted user Dec 16, 2021

Hi,

Due to some backlogs, there is a need for us to input incident start time and end time for the previous incidents. I have created 2 custom fields for this.

Im thinking about adding another custom field (incident duration) and the computation of 2 custom fields (start and end time) would be calculated and appear on that duration field.

Is there a way to do this without installing an app/plugin? I have done the following:

1. Through SLA - cannot choose the custom field to calculate

2. Automation - do not seem to have add calculation / computation on the Action component

 

Appreciate your help.

1 answer

1 accepted

1 vote
Answer accepted

Hi @[deleted] 

You can use "smart values" to make a calculation and update a field value with it.

Use the "Edit issue" action to set your "duration" custom field to something like this:

{{issue.customfield_13455.diff(now).businessDays}}

The above calculates number of business days between a date in customfield_13455 and "now" (today).

You would need to change "now" in the above to your second customfield (and the first to point to the correct customfield). e.g.

{{issue.customfield_1.diff(issue.customfield_2).businessDays}}

Deleted user Jan 06, 2022

thank you, worked for me. :)

Deleted user Jan 06, 2022

hi @Peter Youngman I did make it work, however there is one issue. I changed my custom field from date time picker to number field so it would just give whole numbers instead of date time. 

The automation rule is successful, but the number field shows 0. Is there a need for me to edit anything?

@Peter Youngman - When I write below value its giving difference in days:

{{issue.customfield_1.diff(issue.customfield_2)}}

What value should be written to get difference in 'days, months, years' between two Date fields?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

Atlassian Community Events