It's all about the answers!

Ask a question

Assign User in an attribute based on Team Area


Irell Carloe Santos (2411115) | asked Apr 07 '15, 11:10 p.m.
Hi,

Is there a way for me to assign a User with a specific user role to an attribute based on the team area of the work item? For example, if the workitem is filed in team area "SDLC Rational" the attribute "Project Manager" should display the Project Manager User of that team area. Thanks.

One answer



permanent link
Ralph Schoon (63.3k33646) | answered Apr 08 '15, 2:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As far as I can tell, the only ways to do this are:
  • A Java Based default Value Provider. Example code can be found here: https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ ; Note there is code for finding specific roles at the end of that post and you should be able to reuse most of it
  • A Work Item Save Participant, that sets the value after the save in a second save

Using JavaScript won't work, as there is no way to iterate the team structure in it. The only way would be a static mapping with the contributor UUID's coded into the calculated value provider.


Comments
Irell Carloe Santos commented Apr 08 '15, 3:43 a.m.

i tried doing something like this but the problem is it returns a list with an 'unassigned' value.. is there a way to remove the 'unassigned value'? Thanks by the way for the reply.


Ralph Schoon commented Apr 08 '15, 4:07 a.m. | edited Apr 08 '15, 4:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

What is "Like this"? Why would a calculated value provider return a list?
If you create a Java calculated value provider, you are in control what the return value is. The post provides you with code that can get the user with the role you want.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.