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

I am new to Jira and I'm trying to populate a custom date value to a custom report using midori.

Hello,

I am new to Jira and I'm trying to populate a custom value to a custom Jira report. The value is as below.

Recovery Timeline: 31/Dec/19

We use Midori plugin for it and below is the block of code I'm trying to use. Did I miss something?

#set($recoverytimeline = $customFieldManager.getCustomFieldObjectByName("Recovery Timeline"))
#set($recoverytimelinevalue = $issue.getCustomFieldValue($recoverytimeline).getDateString())
<fo:table-cell padding="1mm" border-width="0.5mm" border-style="solid" number-columns-spanned="2" >
<fo:block space-before="1mm">
<fo:block>$xmlutils.escape($recoverytimelinevalue)</fo:block>
</fo:block>
</fo:table-cell>

2 answers

1 accepted

0 votes
Answer accepted

It was a date field. So I used the below code.

$userDateTimeFormatter.withDefaultZone().withStyle($dateTimeStyle.DATE).format($recoveryimelinevalue)

0 votes
  1. What happens when you use this?
  2. What is the type of the "Recovery Timeline" custom field?
  3. What is the type of the $recoverytimelinevalue object? (How do you know it provides a getDateString() getter?)

Hi Aron,

It was rendering a blank space when I was using the above code. I called it all wrong. With the below, I was able to populate the required value.

it was a date field. So I used the below code

$userDateTimeFormatter.withDefaultZone().withStyle($dateTimeStyle.DATE).format($recoveryimelinevalue)

Awesome! (I'm the original author of the Better PDF Exporter app :-))

Like P likes this

That's nice to know. Midori is making my life a lot easy. Thank you for getting back to me. :)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Align

Best Practices in Jira Align

Hello Jira Align customers! In order to better serve you on your journey with Jira Align, the Community team has worked with the Jira Align team to curate the content in this collection to better s...

166 views 0 8
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