Time in alert Alias
Asked by Pawe? Grams:

Hi,

I'm trying to configure e-mail integration in Opsgenie so it will group all alerts matching some criteria in daily "threads".

In Jira there's a way to use smartvalue {{now.shortDate}} to get today's date. Is there any options to get system to add date in Opsgenie Alias?


Answers:
author: Nick H
body: Hi [@Pawe? Grams](/t5/user/viewprofilepage/user-id/4514634) ,

There are some extra fields not included with the Email integration by default, but specifically parse in the headers of the payload - including the date:

![date1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/209138i986377D5EB894F5C/image-size/large?v=v2&px=999 "date1.jpg")

Since it's nested under the headers, you could use something like this to extract it into the alert:

```
{{_headers.DATE}}
```

![date2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/209139i9D255F723063F777/image-size/large?v=v2&px=999 "date2.jpg")![date3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/209140i0FAAA1273116F694/image-size/large?v=v2&px=999 "date3.jpg")

As well use some form of [string processing](https://support.atlassian.com/opsgenie/docs/string-processing-methods-in-opsgenie-integrations/) or [regex](https://support.atlassian.com/opsgenie/docs/regular-expressions-for-improved-alert-filtering/) to pull only the date, or fine-tune exactly what you need to extract into the alias or other alert fields.

comments: author: Pawe? Grams
body: Hi [@Nick H](/t5/user/viewprofilepage/user-id/2540930)

Thank you for this response. It's great I can access headers data as it will improve our ways of working with Opsgenie a lot!

Thank You!


author: Taha Husain
body: Hi [@Nick H](/t5/user/viewprofilepage/user-id/2540930)

I am trying to do something similar in my opsgenie setup, I am using the below code to get the date but it's somehow always returning null value. I tried to put it in alias and as well in the description. Any idea how I can make it work? I just want current_date or the date in the alias when the alert was created. Thank you in advance.

```
{{_headers.DATE}}
```

comments: author: Nick H
body: Hi [@Taha Husain](/t5/user/viewprofilepage/user-id/5424494) ,

My suggestion above is only related to the [Email integration](https://support.atlassian.com/opsgenie/docs/integrate-your-email-with-opsgenie/). Are you using an Email integration, or another integration?

If you are using another integration - then you would need to review the [Logs tab](https://support.atlassian.com/opsgenie/docs/search-logs/) to see if there is a date field that can be extracted from the payload.

If yes - then you may want to connect with [Opsgenie support](https://support.atlassian.com/opsgenie/) for assistance.


author: Taha Husain
body: Hi [@Nick H](/t5/user/viewprofilepage/user-id/2540930) , sorry I forgot to mention about the integration. I have a AWS SNS integration. Do you have any suggestions for that? Thank you!


author: Nick H
body: I would suggest reviewing the [Logs tab](https://support.atlassian.com/opsgenie/docs/search-logs/) to see if the date is parsing in a field or the payload so it can be extracted into the alert.

Typically we see customers leveraging [string processing](https://support.atlassian.com/opsgenie/docs/string-processing-methods-in-opsgenie-integrations/) or [regex](https://support.atlassian.com/opsgenie/docs/regular-expressions-for-improved-alert-filtering/) to extract fields / data into alerts.


author: Taha Husain
body: Hi [@Nick H](/t5/user/viewprofilepage/user-id/2540930) , I tried using string processing functions as well, for eg please see below code. I am still getting null values. If there's something other than this I can talk to the support.

{{ Timestamp.toDate() }}


author: Nick H
body: You can connect with [Opsgenie support](https://support.atlassian.com/opsgenie/) for assistance. They will be able to review your instance, logs, etc. - and provide suggestions. It will also prevent you from having to share any information or screenshots here you do not want publicly available.