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

How to put checkout revision number of a build in ftl email template

Abhishek S February 16, 2023

Hi 

I want to put revision number (current checkout revision which is used to build) in notificationCommonsHTML.ftl in templateOuter macro before the line "was successful" or "failed". (line 15) 

I tried ${bulidSummary.revision} but no luck. 

FYI: I use SVN repo and corresponding revision number for build

Please help me with this, as documentation for modifying email templates is abysmal.

2 answers

0 votes
Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 6, 2023

Hi @Abhishek S

I don't know where you got that from, but ${bulidSummary.revision} seems like a typo (bulid vs. build) and should probably be ${buildSummary.revision}!?

Other than that I'm not aware of structurally better docs besides what I referenced in my related answer, though the Freemarker section in Freemarker and notification templates might provide a few more clues (note the "#list buildSummary.commits as commit" and "Revision: ${commit.guessChangeSetId()?html}" constructs).

Good luck,
Steffen

Abhishek S March 6, 2023

Hi @Steffen Opel _Utoolity_ 

 

Thanks a lot for the reply. Actually, I tried the correct form of ${buildSummary.revision} (without any typo) but no luck. 

 

(note the "#list buildSummary.commits as commit" and "Revision: ${commit.guessChangeSetId()?html}

The above code looks like, it only works if we have any new commits. Is there any particular package which provides revision number without including any commits?

I think this is pretty simple use case where I want to have the checkout revision inside ftl template. If any package like com.atlassian.* exposes this variable please let me know which package is that and how to use it where I can create a variable and use the functions it provides.

 

Please help me with this.
Thanks in advance !

0 votes
Abhishek S February 19, 2023

Can anyone please suggest an idea/answer?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events