Extract date of state change and save it to a field.
Asked by Soporte Itera:

Hi team, ??

I hope you are well

I am asking for your support with a problem I am having.?

How can I extract the date and time that a ticket moved to a status and save that information in a Jira custom field.

![date to cf.png](/t5/image/serverpage/image-id/297048i49E4A4724C069C89/image-size/large?v=v2&px=999 "date to cf.png")


Answers:
author: Alejandra Rosales
body: Hi [@Soporte Itera](/t5/user/viewprofilepage/user-id/5233665)!

I've got an idea that might help:

Consider utilizing Jira automation. This involves creating a process triggered by status changes and capturing and storing the date in a specific field. Keep in mind, though, that this will overwrite the field with each status change. Here's the basic structure to give you an idea:

![Captura de pantalla 2023-12-15 164433.png](https://community.atlassian.com/t5/image/serverpage/image-id/297075i04E5F5C0D2869AAD/image-size/large?v=v2&px=999 "Captura de pantalla 2023-12-15 164433.png")

```
{
"fields": {
"Description": "{{now.fullDate}}"
}
}
}
```

<br />

And this would be the final result:

![Captura de pantalla 2023-12-15 164614.png](https://community.atlassian.com/t5/image/serverpage/image-id/297078iCACF28381247CE5F/image-size/large?v=v2&px=999 "Captura de pantalla 2023-12-15 164614.png")![Captura de pantalla 2023-12-15 164635.png](https://community.atlassian.com/t5/image/serverpage/image-id/297077i2AA31DE3C4828A31/image-size/large?v=v2&px=999 "Captura de pantalla 2023-12-15 164635.png")

Please feel free to adapt it to your preferred field and adjust it as needed to meet your requirements.

If you need more guidance or have further questions, don't hesitate to ask! :-))

Regards,  
Alejandra  
ServiceRocket Apps Support

comments: author: Soporte Itera
body: Hi Alejandra,

Thank you very much for your collaboration, the automation works perfectly for new tickets that will barely move to the solved status.

I can ask if this same thing is possible but with old cases, that is, is it possible to extract the exact date of the status change but from the history of the ticket?

Currently the ticket is sent to "Solucionado" and then through the satisfaction survey the customer finalizes the ticket and the automatic resolution is placed, but I would need to extract the date on which the person in charge made the transition to "Solucionado".


author: Alejandra Rosales
body: Hi [@Soporte Itera](/t5/user/viewprofilepage/user-id/5233665) ,

Absolutely! I've found a solution in this[Community Post](https://community.atlassian.com/t5/Jira-Content-Archive-questions/smart-value-displaying-the-status-change/qaq-p/2031677) that helps us capture the date when the issue transitioned to its current state. Just to clarify, this method retrieves the date of the issue's most recent status change, not a specific one.

Here's an example of how to set it up using a manual trigger:

![Captura de pantalla 2023-12-19 115759.png](https://community.atlassian.com/t5/image/serverpage/image-id/297406i526097F426A62D6B/image-size/large?v=v2&px=999 "Captura de pantalla 2023-12-19 115759.png")

```
{
"fields": {
"Description": "{{issue.statuscategorychangedate.toDate.fullDateTime}}"
}
}
}
```

This JSON fetches the date and time of the latest status change. You might explore other triggers, such as scheduling, to automate this process periodically.

![Captura de pantalla 2023-12-19 115959.png](https://community.atlassian.com/t5/image/serverpage/image-id/297407iEDE2509F3D96677E/image-size/large?v=v2&px=999 "Captura de pantalla 2023-12-19 115959.png")![Captura de pantalla 2023-12-19 120019.png](https://community.atlassian.com/t5/image/serverpage/image-id/297408iB360AB78E31FA990/image-size/large?v=v2&px=999 "Captura de pantalla 2023-12-19 120019.png")

Feel free to test it out, and if you need more guidance or have further questions, don't hesitate to ask.

Regards,  
Alejandra  
ServiceRocket Apps Support


Tags: cloud

jira-service-management

jira-service-management-cloud