How to automatically assign categories (filed_against attribute) to work item ?
Gilles Trautmann (36●3●4)
| asked Nov 08 '12, 10:34 a.m.
retagged Nov 08 '12, 8:00 p.m. by Millard Ellingsworth (2.5k●1●24●31)
Hi all,
I am new to RTC (3.0.1.1) and I am currently trying to build a new Project Area. In this project area we have two team areas and one work item category for each team area. Categories are listed as follows Unassigned <Root Category> L London L Paris London is associated with London Team area and Paris is associated with ParisTeam area. When I create a new work item, depending on the user and the team area he belongs to, I would like to have the work item filed against the right category. However it is always filed under "Unassigned" which is the top level category (associated with the Projet Area). Is there a way to avoid that ? Thank you very much |
Accepted answer
Here it is.
This is a "Validator" script. You need to assign it to the attribute you want the retrieve the UUID and you will get the info in the "Error Log" view. Tell me if that helped :) And good luck Script : dojo.provide("Validator.Util"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { dojo.declare("Validator.Util", null, { validate: function(attribute, workItem, configuration) { console.log("ATTRIBUTE : " + attribute); var value = workItem.getValue(attribute); console.log("VALUE : " + value); return Status.OK_STATUS; } }); })(); Ralph Schoon selected this answer as the correct answer
|
5 other answers
Ralph Schoon (63.3k●3●36●46)
| answered Nov 09 '12, 8:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As far as I can tell, there is no such automation available. You can create an attribute customization that sets a general default category that you can choose. But there is no automated way that ties the work items category to the owner.
There are capabilities in Java Script based customizations, however, they are very limited and I think you would have to hard code a mapping of user ID's to the category ID's if you want to use that. The other way I can think of is a follow up action that could do this task. See https://jazz.net/library/article/1000 on how to get started. |
Thank you for your answer Ralph.
As the teams are only made of 4 or 5 people, I decided to write a Script based customization. The script was quite easy to write and it seems that the other solution you were offering is only suitable for RTC 4.0 (I am using RTC 3.0.1.1) Thank you Comments
Jean-Michel Athane
commented Jan 15 '13, 7:14 a.m.
Hello Gilles, Can you please explain here how you refer to Category values in your script. I try to find the information, but do not find any example. (for instance, in my script, I want to return the value of the category "Development"). Thanks for the information !
Jean-Michel, I would assume he was using
|
Hi Jean-Michel,
Could you please provide with an extract of your code ? Basically what I did : - I mapped each user with his UUID (I retrieved this UUID with a small script I can send you if you want) - I mapped each user with his Category's UUID (retrieved the same way as previously) and then I set the "Filed against" attribute with this UUID. This was not very hard in my case because there aren't a lot of users so the mapping was easy. You might want to do something like this : ojo.provide("SED.ValueProvider.Filed_Against"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { dojo.declare("SED.ValueProvider.Filed_Against", null, { getValue: function(attribute, workItem, configuration) { var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes; var userUUID = workItem.getValue(WorkItemAttributes.CREATOR); var Gilles_TrautmannUUID = "_FfmcsOsbEeGD1r7xkMLeGw"; // Retrieved via another script var ParisUUID = "_fgW3gCjiEeKOcJXMBz1GaA"; var LondonUUID = "_61ClUh9NEeKJDq__QfUm3A"; switch (userUUID) { case Gilles_TrautmannUUID: //console.log("Gilles"); return LondonUUID; case else: return ParisUUID; } } }); })(); The UUID thing was mandatory (I assume in RTC 3.0.1.1) but I think that now you can directly retrieve the value (i.e the "displayed" value, in my case Gilles Trautmann instead of _FfmcsOsbEeGD1r7xkMLeGw). However this needs to be confirmed Hope this helps Comments
Jean-Michel Athane
commented Jan 15 '13, 9:28 a.m.
Great ! Yes I'm interested by the way you get the UUIDs. Thanks again.
marina delunas
commented Jul 24 '13, 4:13 a.m.
HI!!!
See the AttributeValueAnalyzer in Lab 4 of the Process Enactment Workshop |
It worked ! Thanks for the tip, it is exactly what I wanted to know.
|
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.