How to get value "Time in Status" = "Deveploping" in Jira Automation Smart value
Asked by Th?i L? Ho?ng:

I want to track "Time in Status" = "Developing" for each subtask, so i use Jira Automation to store that value to a custom field.

How to get value "Time in Status" = "Deveploping" in Jira Automation Smart value?


Answers:
author: Trudy Claspill
body: Hello [@Th?i L? Ho?ng](/t5/user/viewprofilepage/user-id/5557045)

Welcome to the Atlassian community.

Generally you get data from an issue in Automation using a smart value like

{{issue.*insert name of field here*}}

You have to use the same capitalization and blank spaces there that you see when the field name is displayed on the screen.

If you share with us the details of your Automation we can provide advice that matches your specific scenario.

What do you want to do with that field data in the Automation?

What type of field is it?

comments: author: Th?i L? Ho?ng
body: I want to store the value of "Time in Status" = Developing for each subtask. This is an automatic customize field of Jira.

Purpose: Calculate "Total spent time in developing state" for each epic (parent of many User Story, Subtask)


author: Trudy Claspill
body: Hello [@Th?i L? Ho?ng](/t5/user/viewprofilepage/user-id/5557045)

I'm not sure that I understand your question.

Are you asking how to create an Automation that will figure out and record how long an issue has been in assigned the status named "Development"?

Are you saying you already have that information recorded in a field named "Time in Status", and you want to sum up the values in child issues and record the sum in the parent issue?


author: Th?i L? Ho?ng
body: Are you saying you already have that information recorded in a field named "Time in Status", and you want to sum up the values in child issues and record the sum in the parent issue? \>\>\> That's right!!

As I described above, "Time in Status" is an custom field, it store value in JSON format. Look at the picture below for detail.

I want to get convert the result to "Hours" or "Minutes"![Variable.png](https://community.atlassian.com/t5/image/serverpage/image-id/339295i9752430796088F00/image-size/large?v=v2&px=999 "Variable.png")![Json_Result.png](https://community.atlassian.com/t5/image/serverpage/image-id/339296i86A737E10CCFECB9/image-size/large?v=v2&px=999 "Json_Result.png")


author: Trudy Claspill
body: According to the documentation for asJsonObject:

"Transforms a text value into a JSON key/value pair object. The keyName property is used as the name of the field, as shown below."

I haven't used that function before.

What is the custom field type of the "Time in Status" field? Is that a custom field you created or one provided by a third party app?

Or is it the native Jira field seen here?

![Screenshot 2024-08-02 at 9.45.05?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/339763iC1CF83458F381E3C/image-size/large?v=v2&px=999 "Screenshot 2024-08-02 at 9.45.05?AM.png")


author: Trudy Claspill
body: It seems like you might be referencing the native "\[CHART\] Time in Status" field.

Looking at another answer provided by [@Mehmet A _Bloompeak_](/t5/user/viewprofilepage/user-id/3740047) in [this other post](https://community.atlassian.com/t5/Jira-questions/How-to-read-Chart-Time-in-Status/qaq-p/2039438) it seems like you would need to parse the data in the Json object to determine which portions of the entry represent the time spent in the Developing status for each of the child issue, and find a way to sum that up.

What you want to do is beyond my expertise for text parsing and Automation rules.

In general terms I think it would be necessary to pull the information from the Json object and then store it into a field in each child issue. Then you could use a separate steps to sum up the values through a Lookup Issues action.


author: Th?i L? Ho?ng
body: Thanks for your support.

I couldn't convert Json format to number (minutes/hours), anw I found a work around solution as below:

1. Capture actual time when issue start developing.
2. Capture actual time when issue end developing.
3. Store duration diff between #1 and #2 in an custom field.

Maybe this isn't the best solution, however it work for our context at this time.


author: Mehmet A _Bloompeak_
body: Hi [@Th?i L? Ho?ng](/t5/user/viewprofilepage/user-id/5557045)

Welcome to the Atlassian Community!

If you prefer using a marketplace app, you can try [Status Time Reports](https://marketplace.atlassian.com/1221826) app developed by our team. It mainly provides reports and gadgets based on how much time passed in each status.  

Here is the [online demo link](http://status-time.bloompeak.io/demo), you can see it in action and try without installing the app. For your case, you can have a look at [Time in Status for Each Issue](https://bloompeak.atlassian.net/plugins/servlet/ac/io.bloompeak.status-time/st-report?ac.reportid=11) report.

For further details, you can have a look at [Status Time Reports How to Videos.](https://www.youtube.com/playlist?list=PLVHoaAkoFPJnG9nLkzcxG0P00ndQgimDs)

++App Features:++

* This app has a dynamic status grouping feature so that you can generate various valuable reports as**time in status, time in assignee, status entry dates and status counts, cycle time and lead time, resolution time, average/sum reports by any field(e.g. average in progress time by project, average cycle time by issue creation month)**.

* You can search issues by Project, Issue Type, Status, Assignee, Issue Creation/Resolution Date(and any other Date field) and JQL Query.
* Status durations are calculated according to the working calendar you define. Once you enter your working calendar into the app, it takes your working schedule into account too. That is, "In Progress" time of an issue opened on Friday at 5 PM and closed on Monday at 9 AM, will be a few hours rather than 3 days.
* You can set different duration formats.
* You can export reports in CSV file format and open them in MS Excel.
* You can also add this app as a gadget to your Jira dashboards and reach "Status Time" from Issue Detail page.
* You can enable/disable access to Status Time reports\&gadgets and Issue Detail page per project, users, groups or project role.

If you are looking for a completely **free** solution, you can try the limited version [Status Time Reports Free](https://marketplace.atlassian.com/apps/1222051).

If you have any questions, feel free to [schedule a demo](https://bloompeak.io/schedule-a-call) with us.

Hope it helps.

comments: author: Th?i L? Ho?ng
body: Thank you for your solution. Does it work in Jira Automation Smart Value?


author: Mehmet A _Bloompeak_
body: Due to secure design of the app, the app neither processes nor stores the issue data on our servers. That is, it calculates the status duration on the client side inside the browser when you open the page. One side effect of this secure design is the lack of storing status duration in a custom field. Therefore, the report results are not available for Jira Automation.


Tags: cloud

cloud-automation

jira-cloud