Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Reduce lines and blanks in a velocity template

Sebastian
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 14, 2019

Hi,

I've created the following code in a velocity template:

#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_10900"))
#if ($issue.getCustomFieldValue($customfield))
#-> $stringUtils.leftPad($customfield.name, $padSize): $issue.getCustomFieldValue($customfield)
#end
#if ($issue.getDueDate())
#-> #text("Fälligkeitsdatum"): $issue.getDueDate()
#end
#->$stringUtils.leftPad($i18n.getText("common.concepts.url"), $padSize): ${baseurl}/browse/${issue.getKey()}

 The result is ok, but not perfect:

#->                   Service: Servicename

      #-> Fälligkeitsdatum: 2019-08-15 00:00:00.0


#->                                URL: https://domain.net/xyz

 How could I reduce the blanks and the blank lines to get the following result?

#-> Service: Servicename
#-> Fälligkeitsdatum: 2019-08-15 00:00:00.0
#-> URL: https://domain.net/xyz

Best,

Sebastian  

1 answer

1 accepted

0 votes
Answer accepted
Iago Docando
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 14, 2019

Could you simply make &padsize=0? I realize when you just use 

#text("Fälligkeitsdatum"):

there're no extra blank spaces.

 

I'm only guessing but I hope it helps.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events