I wonder if you used the customfield ID would it make a difference? Replace the Xs with the field ID number.
{{issue.fields.customfield_xxxx.diff(issue.fields.customfield_xxxx).days}}
Thanks for the help Tim!! Would you be able to help me with where to find the customfield ID?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you go to settings --> Issues --> Custom Fields. You can search for the custom field. Once you find the custom field you should see 3 dots, click on this then hover over edit and you will see a URL on the bottom of your browser and at the end of the URL you should see the ID. Something like below:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same requirement and tried this approach but the value ends up being zero instead of one day. What do I miss?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Fenner Matheus - Welcome to the Atlassian Community!
Try this: {{issue.Acceptance date.diff(issue.Lead time start).days}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for helping me out, John!! I have implemented your suggestion and it let's me publish the automation, but it doesn't update the field =(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In this automation I also populate a different field with the current date, and this action is working fine...just the date diff that isn't =(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And what value does it put in the Lead time field? Just nothing?
Also, but custom fields are the same type of date fields?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The suggestion below given by Tim helped me get it to work. Thanks also for your help, John!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Team
My question is similar in line to what Fenner Mateus started with this discussion on. Thanks to him for bringing up such an important topic and Thanks to the team for the wonderful pointers.
I applied a formula similar to the one listed above ( {{issue.Acceptance date.diff(issue.Lead time start).days}} ) to the Automation Rule.
The 1st formula I applied yielded negative value
Formula was - {{issue.Resolved.diff(issue.Created).days}}
Wherein the Created and Resolved values were as listed below
Created: 18 Dec 2023 12:10 pm
Resolved: 1/25/2024 3:38 pm
Answer: -38
Changed the formula to
{{issue.Created.diff(issue.Resolved).days}}
which yielded a positive value for these dates
Created: 26/Dec/23 10:42 AM
Updated: 08/Jan/24 6:41 PM
However the value returned was off by 1 day is what I think.
Computer value: 30 days.
2 Given today is 26th Jan 2024 and we go back to 26th Dec 2023, should'nt the value be 5 days for Dec and 26 Days for Jan to a total of 31 days ?
Just wanted to run by the team for sanity purposes.
Thanks
Surti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Fenner Matheus ,
I know this question is focused on configuring automation rules but it looks like you are trying to calculate a Lead Time metric. I can offer another way that is much easier, more flexible, and more powerful.
Our team at OBSS built Timepiece - Time in Status for Jirafor these kinds of reporting. It is available for Jira Server, Cloud, and Data Center.
Time in Status allows you to see how much time each issue spent on each status and on each assignee.
The app has Consolidated Columns feature. This feature allows you to combine the duration for multiple statuses into a single column and exclude unwanted ones. It is perfect to get measurements like Issue Age, Cycle Time, Lead Time, Resolution Time etc.
It is worth noting here that the app calculates its reports using already existing Jira issue histories so when you install the app, you don't need to add anything to your issue workflows or set any automation rules. You can get reports on your past issues as well. It supports both Company Managed and Team Managed projects.
For all numeric report types, you can calculate averages and sums of those durations grouped by the issue fields you select. For example total in-progress time per customer (organization) or average resolution time per week, month, issuetype, request type, etc. The ability to group by parts of dates (year, month, week, day, hour) is particularly useful here since it allows you to compare different time periods or see the trend.
Time in Status reports can be accessed through its own reporting page, dashboard gadgets, and issue view screen tabs. All these options can provide both calculated data tables and charts.
And the app has a REST API so you can get the reports from Jira UI or via REST.
Using Time in Status you can:
Timepiece - Time in Status for Jira
EmreT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.