How to get the projectID in velocity templates (*.vm)

Adria Alonso
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.
October 8, 2019

Hello,

I'm working on a custom Release Notes and I facing the following issue:

  • I have to create a link in the releasenotes.vm file and I need Version Id and the project id.
  • To get Version id It was pretty fast, but I cannot figure out a way to get the project id, $project returns its name, i've been testing but without no luck

#set($ver = $versionObj.id)  works perfelcty

What is needed to retrieve the same for the project?

Thank you

 

1 answer

1 accepted

0 votes
Answer accepted
Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 8, 2019

Hi @Adria Alonso 

It depends on the context. If on server side you put versionObj to the context you can use below samples to get projectId

#set($projectId = $versionObj.projectId)

or 

#set($projectId = $versionObj.project.id)

 I hope it helps

Adria Alonso
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.
October 9, 2019

works like a charm!

Thank you

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 9, 2019

Glad that it works :) 

Like Adria Alonso likes this

Suggest an answer

Log in or Sign up to answer