Forums

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

Auto fill number field based on date field

Sagi Gueta
Contributor
October 31, 2022

Hello,

I'm trying making automation (by Jira Automation App) that will set a value on number field based on:

Creation Date [minus] Closing Date

Yet I don't really know how should I make it. 

So far my idea was to make a smart value as shown in attached file, but ofc didn't work :(

What shall I do to make it work?

Closing Duration.JPG{{issue.created

1 answer

1 accepted

1 vote
Answer accepted
Florian Bonniec
Community Champion
October 31, 2022

Hi @Sagi Gueta 

You have to use diff function for that.

{{issue.closed.diff(issue.created).days}}

You can change the unit as you want, please check the documentation.

Documentation :

https://confluence.atlassian.com/automation/jira-smart-values-date-and-time-993924864.html

 

Regards 

Sagi Gueta
Contributor
October 31, 2022

Thanks for the tip, though I guess I did something wrong..

By the method you suggested to use, it should fill the field with number right? Unfortunately it didn't work when I did it.Automation.JPGAutomation 2.JPG

Florian Bonniec
Community Champion
October 31, 2022

I think what you want is 

 

{{issue.resolved.diff(issue.created).days}}

closed will only work if you created the field. resolved is a system field that store the resolution date.

 

Regards

Like Sagi Gueta likes this
Sagi Gueta
Contributor
November 3, 2022

Thanks alot it worked eventually!

Suggest an answer

Log in or Sign up to answer