Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Format of a Date Picker Custom field in an Email post-function (ScriptRunner)

Edited

How to change the format of my Date Picker Custom field in my Email post-function please ?
I am using this in the Email template : 

<% out << issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("DatePickerCustomFieldName")) %>

And I am getting this :

2018-04-23 00:00:00.0

I'd like to get :

23-04-2018

 Thank you for your help !

2 answers

1 accepted

Hi,

You could try:

issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("DatePickerCustomFieldName")).format("dd-MM-yyyy")

 

It's working fine for me, maybe it works for you too.

Regards,
Marcos

Thank you ! it works well

I get: 

No signature of method: com.atlassian.jira.issue.fields.ImmutableCustomField.format() is applicable for argument types: (java.lang.String) values: [dd-mm-yyyy]

def subTaskCustomField17127 = com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_17127")
def customFieldValue17127 = issue.getCustomFieldValue(subTaskCustomField17127.format("dd-mm-yyyy"))

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

102 views 1 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you