how can I get the current or selected 'Version' of the Project while browsing Versions?

Joseph Copty September 5, 2012

Hi all,

thanks in advance for reading this and your help.

I am trying to create a 'Version Tab Panel Plugin Module' for my pluggin, which is described here:

https://developer.atlassian.com/display/JIRADEV/Version+Tab+Panel+Plugin+Module

However I am trying to access the current fix version. How can i do this?

So say we are on this page:

http://localhost:2990/jira/browse/TMS/fixforversion/10000

the end of the URL '10000' would be the version id, how do i obtain this OR obtain the Version name for example '1.0.1.1'?

I know you can get all versions of a project using something like this

ProjectManagerpm = ComponentAccessor.getProjectManager();

Project p = pm.getProjectObjByKey(projectKey);

Collection<Version> versions = p.getVersions();

but this is not what i am after. Just the current selected fixversion

1 answer

1 accepted

1 vote
Answer accepted
Mizan
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.
September 10, 2012

Hi Joseph ,

If its a version tab panel i assume you have overriden the below method

createVelocityParams (BrowseVersionContext context)

in this method paste the below code snippet

Version version=context.getVersion();

Joseph Copty September 11, 2012

Hi,

thanks this is exactly what i needed. i initially did not have the <version-tabpanel> set properly.

It was pointing to the com.atlassian.jira.plugin.versionpanel.impl.GenericTabPanel instead of my class which extends this.

thats why nothing was being picked up.

Thanks again for your help.

cheers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events