Need help covert the number to time
Asked by Devarajan Mani:

I have a short text custom field to capture manually entered value ex: 29 hours

I need to convert this similar to time in status format ex: 1d 5h 23m

Is there a way to convert to the above format?

Thanks

Dev


Answers:
author: Trudy Claspill
body: Hello [@Devarajan Mani](/t5/user/viewprofilepage/user-id/5503373)

There is not a native conversion function to change text into the "pretty" version of duration that Jira displays. You would have to create you're own conversion process. With a text field that is going to be complex because the text may not be entered in a standard and validated format. It would be easier if it was a number field and you used it to enter just a specific type of duration - only hours, for example.

You would also have to consider how many hours constitute a "day" and how many "days" constitute a "week".

What problem are you trying to solve by having a field where you enter duration? And what problem are you trying to solve by converting the display format for that information?


author: Valeriia_Havrylenko_SaaSJet
body: Hi [@Devarajan Mani](/t5/user/viewprofilepage/user-id/5503373) ?

If you consider installing third-party add-ons to help, you can try marketplace add-ons with time formats feature. One if them is [Time In Status](https://marketplace.atlassian.com/apps/1219732/time-in-status-for-jira-cloud?hosting=cloud&tab=overview&utm_source=Atlassian_Marketplace&utm_medium=referral&utm_campaign=Comment_Need-help-covert-the-number-to-time_20240812) add-on.  

For instance, here is how it will be visualized for the Time In Status report:  

![2024-05-30_12-01-21.png](https://community.atlassian.com/t5/image/serverpage/image-id/326889i19C18CABDD1923C7/image-size/large?v=v2&px=999 "2024-05-30_12-01-21.png")

The**Format** option lets you select the time format of status duration:

* Minutes

* HoursMinutes

* Hours:Minutes

* DaysHoursMinutes

* Decimal Weeks

* Decimal Hours

* Decimal Days

* Business Decimal Weeks

* Business Decimal Days

* Business DaysHoursMinutes

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/341350i4BCAC952E0CFE2D1/image-size/large?v=v2&px=999 "image.png")

You will also be able to access Time in Status data in the Dashboards.

![?????? ?????? 2024-07-31 ? 13.53.29.png](https://community.atlassian.com/t5/image/serverpage/image-id/339106iD01B2841B72BE57D/image-size/large?v=v2&px=999 "?????? ?????? 2024-07-31 ? 13.53.29.png")

You can [book a live demo](https://calendly.com/vitalii_meeting/time-in-status?utm_source=Atlassian_Marketplace&utm_medium=referral&utm_campaign=Button_more-info) - we'll show you the application inside out and answer all your questions.  

Add-on have [30-day free trial](https://marketplace.atlassian.com/apps/1219732/time-in-status-for-jira-cloud?hosting=cloud&tab=overview&utm_source=Atlassian_Marketplace&utm_medium=referral&utm_campaign=Comment_Need-help-covert-the-number-to-time_20240812) and free up to the 10 users.

I hope you find this helpful ?


author: Joseph Chung Yin
body: [@Devarajan Mani](/t5/user/viewprofilepage/user-id/5503373)

I agreed with [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) stated. The problem with short text data type field is that there is no nomenclature format control against what users enter into the field.

Example -

One can entered 27 hours, and another one can entered 27 hrs or even 27 h or just 27.

It will be very complex to design the conversation process around a text field. I would recommend that you to create a integer field, at the minimum, it is easier to convert number into date/time value.

Again, what are you trying to achieve for the existing custom text field to conduct what action?

Please advise.

Best, Joseph Chung Yin


Tags: cloud

jira-service-management

jira-service-management-cloud