Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,366,439
Community Members
 
Community Events
168
Community Groups

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

Atlassian Community Events