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

Calculate the difference between two custom fields

Dave Jones January 8, 2023

I am attempting to calculate the difference between two custom fields (in days) and populate the result into a number field. 

See screenshot below for what I have entered.

 

I get an error message which states "Additional fields contains invalid field(s) in 'update' or 'fields' section: Custom Field Name" but this does not tell me at all where the issue is. I have tried various variations but get no where.

Jira error.png

 

Thanks for your help.

2 answers

2 accepted

4 votes
Answer accepted
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2023

Hi @Dave Jones 

I recreated this, using the Start Date and End Date fields, and using this smart value:

{{issue.customfield_10123.diff(issue.customfield_10456).days}}

^ And it worked as expected.

What does the rest of your rule look like? Are these both Date Picker fields?

Ste

Dave Jones January 8, 2023

Thank you for your quick response. I have tried the same as you entered but it still does not work for me:

 

Jira error.png

 

Below are the screenshots of the custom fields so you can see their IDs:

 

Date Root Cause Populated.pngDate Assigned to AEMO.png

 

Here is the rest of the rule, but there does not seem to be anything unusual? I should explain I am very new to this so I am probably missing something basic.

 

Automation Rule.png

1 vote
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2023

Hi @Dave Jones and welcome to the community,

Are these two custom field date fields? From the looks of it, the second field, to which you have append the suffix .value, isn't a date field. So I'm not sure you can calculate the difference in days.

Dave Jones January 8, 2023

Hello Alex. I have posted screenshots of both custom fields above. They are both Date fields. I have tried without the value suffix and it still does not work.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2023

@Dave Jones close the additional fields (JSON) which you have opened ("more options").

Dave Jones January 8, 2023

:) Thank you. That was it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events