add access to ComponentManager in CustomFields via parameter (for exapmle $componentmgr) withith velocity script

Description

Hello,

Please, consider adding access to ComponentManager via parameter within velocity script.
Now I need to use separate plugin that expose ComponentManager via CustomField.

Environment

None

Activity

Show:
Former user
March 19, 2012, 1:19 AM

I understood that it is too risky. May be you can add separate Calc. Custom Field that will expose ComponentManager.

Former user
March 19, 2012, 1:23 AM

I have to think about it

Former user
March 19, 2012, 7:25 AM

My usages of ComponentManager are

  1. set($ps = $cmpMgr.getUserPropertyManager().getPropertySet($reporter)) - to take User properties

  2. $cmpMgr.getJiraAuthenticationContext().getLoggedInUser().name - get current Jira username

  3. $cmpMgr.getCrowdService().isUserMemberOfGroup($reporter.name,"sphere-employees") - detect if come user is member of group

  4. etc...

I will try to perform admin task by componentManager under non-admin user - as I understood it must fail because $cmpMgr.getJiraAuthenticationContext() is current user - not Admin user

Former user
March 19, 2012, 8:33 AM

Sorry, too dangerous for the std. usage.

Workaround:
Build and install a Plugin which uses the JIRA Metadata Plugin. See Sample Code:
https://bitbucket.org/aspall/jira-metadata-addonsample/downloads/jira-metadata-addonsample.zip
and
https://bitbucket.org/aspall/jira-metadata-addonsample/src

(The Sample Plugin was build with Eclipse, https://developer.atlassian.com/display/DOCS/Installing+the+Atlassian+Plugin+SDK and JIRA 5.0)

Former user
March 19, 2012, 9:46 AM

Thank you.

Assignee

Former user

Reporter

Former user

Labels

None

Fix versions

Affects versions

Priority

Major
Configure