Jump to content

Recommended Posts

Hello,

I am using h_custom_21 in my capture for a date field and I want to map that to the summary of the request in the Business Process.

I have done this, but when I log a test request, it is putting the date in backwards, i.e. 2020-08-05 instead of 05-08-2020. Is there a way around this please?

Many thanks,
Alisha

Link to post
Share on other sites

@Alisha the "backwards" format you mention is actually the UTC format for date/time and it's the format that is stored in the database. From what I know the formatting on these values only work when used in the UI or in email templates. I'll ask dev team to see if this should work when used as you do.

  • Thanks 1
Link to post
Share on other sites

There is some information here on the wiki which may help.  If I understand correctly, you have a date stored in a custom date field and using the BPM you want to get this date from this field and populated it as part of the summary.  You can add some extra brackets around your variable and in the summary field of a request this is converted to the date format set under the user's profile.

image.png

  • Thanks 1
Link to post
Share on other sites

Hi @James Ainsworth,

This has worked on the summary line, thank you very much!

However, when the resolution email is sent, it puts in the date the other way around again as we're using h_summary on the email template. Is there a way around this?

Many thanks,
Alisha

Date format on request.png

Date format on email.png

Link to post
Share on other sites

Hi Alisha,

Yes, there is some documentation here under the Modifiers section regarding this.  The modifier in this case is formatLocalTime.  You need to add this at the end of your variable that you use in the email template.  The field that the variable refers to must be a date/time field.  You may also want to check the mentioned system settings to make sure that they are in the format that you are wanting.  

{{.datetimevariable|formatLocalTime}} = Allows formatting of date/time variables using system regional settings (system.RegionalSettings.timezone & system.RegionalSettings.dateTimeFormat). Without this formatting the date time will use the DB value (UTC).

I hope that helps.

Regards,

James

 

  • Thanks 1
Link to post
Share on other sites
  • 2 weeks later...

Hi @James Ainsworth,

Our email template is just looking at the h_summary field. We mapped h_custom_21 to the summary field with some other text. It's showing correctly when the request is logged, but on the email it shows the UTC format again.

Many thanks,
Alisha

Link to post
Share on other sites

The modifier formatLocalTime only works with date/time variables/fields.  The summary field is a text field.  The date that you are displaying in the summary is still the original date format.  The extra square brackets that you add on the variable is just a markup to use the date in the users set timezone.  So, if you and I were both looking at the same request and the same summary, we would actually see a different date displayed as we are in different timezones.

Within Hornbill, we can interpret the square brackets in the text field to mark up the date to display the user's set timezone.  

image.png  

However, in the email template the date is being seen as as text, and unable to do the conversion.  If it was coming from a date field, it would know to convert the date.

Maybe there is something else that we also need to consider that is higher up the chain here.  What is the need to include the date in the summary? Would I be right in saying that this is a due date which you would like to be very visible and at the moment, outside of the Service Targets, there is no due date field that accomplished this?

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...