Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I calculate variance (number) between 2 custom field date fields (baseline date and due date)

I have created 2 custom field date fields (baseline date and due date)

I have also created a third custom numeric field called variance.

How can I get the following result

baseline date - 15 Apr 2021

due date - 30 Apr 2021

variance in days is -15

I have been trying automation but no luck. appreciate if you can provide solution thanks

3 answers

0 votes
Rohan Swami Atlassian Team May 24, 2021

@hdave I'm a Product Manager on the Jira Software team, I'd love to get a deeper understanding of what you're looking to achieve with these calculations in Jira Software. Could you drop me a message at r swami @ atlassian . com and we can arrange a call to discuss?

doing now... thanks Rohan

0 votes
Curt Holley Community Leader May 20, 2021

Using Automation for Jira you should be able to populate your variance field by putting something like this in it.

As in, use the edit issue action, select the Variance field and add:

{{(issue.baseline date).diff(issue.due date).days.abs}}

Then hit "enter" on your keyboard (to make it stick)

Have a look at this page for further assistance Smart values - date and time functions | Jira Software Cloud | Atlassian Support 

0 votes

@hdave -

Can you confirm if this ask is related to Advanced Roadmap?  Based on your ask, I am assuming you are referring to Jira custom fields setup and it is really not related to Advanced Roadmap.  If it is for Jira custom fields setup, then you can create "Scripted Field" (essentially a calculated field) to achieve what you are asking.

The create "Scripted field" in Jira, you will need Script Runner for Jira add-on (An excellent add-on to have in your system from my years of Jira admin/functional leads experiences)

In our environments, we have many scripted fields that provide variance dynamically and we expose them into our Jira/JSM projects issues.

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc.

thanks Joseph What I need is a variance in date fields .. since there is no function for data 1-date 2 , i had to use a third field. I would ideally like to manage it out of box - with no extra plugins but if there is no way out then I will have to apply the plugin thanks 

@hdave -

Can you confirm what application are you referring?  Jira Software or JSM?  In addition, what is your env type? (CLOUD or Data Center)

Best, Joseph

Like Curt Holley likes this
Curt Holley Community Leader May 21, 2021

Good questions @Joseph Chung Yin  I always assume people are on Cloud ☁

Like Joseph Chung Yin likes this

@Curt Holley -

If the user's env is JSM cloud (non-premier account), then I don't believe Automation for Jira is a auto add-ons.  Anything associated with DC or server env, Automation for Jira is a separate paid add-on.

Best, Joseph 

Curt Holley Community Leader May 21, 2021

I think It is available of Cloud standard @Joseph Chung Yin , but has restrictions on Multi Project and Global rule executions. Agreed plug-in for non-cloud 👍

Definitely be good to know exactly what setup @hdave is using.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

527 views 1 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you