I'd like to display a message, indicating (This will be automatically assigned to Project role DEFAULT_BAL (=userx)). I need to extract a user from a project role from an issue. My groovy script is ok.
I've tried to insert thisgroovy script in velocity, but in velocity this line gives an error ....ProjectRoleManager.class
Any idea ?
Thx
<B>
<FONT color="blue" style="BACKGROUND-COLOR: yellow">Infobox2</FONT>
<ul>
<FONT color="green">
#set($issueid = ${issue.getKey()})
#set ($thisType = $issue.getIssueType().getString("name"))
#set ($name = $authcontext.user.getFullName())
#set ($resolution = $issue.getResolutionObject().name)
#set ($status = $issue.getStatusObject().name)
## project
#set ($proj = $issue.getProjectObject())
#set ($componentManager = $ComponentManager.getInstance())
#set ($projectManager = $componentManager.getProjectManager())
#set ($projectRoleManager = $ComponentManager.getComponentInstanceOfType(ProjectRoleManager.class))
## role
#set ($pjrole = 'Default-BAL')
#set ($devsRole = $projectRoleManager.getProjectRole($pjrole))
#set ($actors = $projectRoleManager.getProjectRoleActors($devsRole, $proj))
<li>pjrole = $pjrole</li>
<li>actors = $actors.getUsers()</li>
<li>actors = $actors.getUsers().size()</li>
<li> $proj.key - $proj.name - $proj.lead - ${proj.getId()} - $proj.getKey() - ${proj.getName()}</li>
<li>Key = ${issue.getKey()} - $issueid</li>
<li>userid = $issue.assigneeUser - username = $name </li>
<li>Type = $thisType - resolution = $resolution - status = $status</li>
<li>Assignee = $issue.getAssigneeUser() - reporter = $issue.getReporterUser()</li>
<li>Env = $issue.getCustomFieldValue($customFieldManager.getCustomFieldObjectByName("Environment"))</li>
<li>Field4 = $issue.getCustomFieldValue($customFieldManager.getCustomFieldObjectByName("Field4"))</li>
</FONT>
</ul>
</B>
Exactly this is the conversion (adding #set ....) groovy to velocity for a "velocity-processed custom field (edit).
The result is there (in green):
A lot of fields are correctly extracted and displayed, but not the first project role user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where are you inserting this? BTW this is not groovy, it's velocity. Are you using the velocity-processed custom field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.