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

P December 16, 2019

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

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
P December 17, 2019

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

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

0 votes
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 17, 2019
  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?)
P December 17, 2019

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)

Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 17, 2019

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

Like P likes this
P December 17, 2019

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

TAGS
AUG Leaders

Atlassian Community Events