Hi,
I have created 2 custom field for 2 different time :
1. Created Time (Custom field - Date Time Picker)
2. Reported Time (Custom field - Date Time Picker)
3. Result (Numeric Field)
Automation rule created : {{issue.customfield_10134.diff(now).minutes}}
I like to display the result in h:mm:ss.
What is the right rule to apply?
Hello @Fikri Ahmad
Welcome to the Atlassian community.
Since Jira does not have a Time/duration custom field, if you want to display a duration in hours:minutes:seconds you have to perform your own calculations to get those values. You can find documentation on math operations with smart values here:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/
You specified that your Result field in a Number field. You can display only numbers in such a field. You will not be able to add colons to the data format of that field. To display the duration in the format hours:minutes:seconds you'll have to put that information into a Text field.
The diff() function smart value you are using will give you the result in Minutes ( {{issue.customfield_10134.diff(now).minutes}} ). If you want to display that as hours:minutes you'll have to divide the result by 60 to get the hours. You could store that in a variable you create using the Create Variable action. Subtract 60*hours from the diff() result to get the remaining minutes. Store that in another variable you create using the Create Variable action.
You can then concatenate the values in the variables and the colons and store the result in your custom text field; i.e {{varHours}}:{{varMinutes}}
Tq Trudy for the explanation.
One more questions.
How about Created Time and Resolved Time generate by the system, can we also calculate for the duration in hours:minutes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is your Resolved Time field? I don't have a Resolved Time field natively in my system, which includes both Jira and Jira Service Management.
There is a native field "Time to resolution" that automatically calculates the difference between the issue Created timestamp and the issue Resolved timestamp, and displays the duration in hh:mm format. However that field is calculated only for issues in Jira Service Management projects. In the below image CUS is a JSD project and ACK is a JSW project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fikri - Welcome to the Atlassian Community!
What do those two custom fields represent? There is already a Created system field that captures the date and time of when the issues was created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually those 2 field created to calculate the different time (in hour & minutes formatting) between reported time and created time.
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.