How to count the number of attributes in a WItype ?
Accepted answer
The easiest way I can think of is to count the attribute entries in the process configuration source. RTC Eclipse client may not have this feature, but any advanced text editors, such as Notepad++, have the feature to count the occurrence of patterns. Custom attributes look like this in the source.
<customAttributes category="com.ibm.team.workitem.workItemType" >Search "</customAttributes >" should give you the exact number.
<customAttribute id="Browser" name="Browser" type="enumerationList$browser" />
</customAttributes >
Comments
Thx Don,
My comment is too long: will use the answer for it.
Thx Don,
For the quick and right answer. Didn't get the full understanding of what to look for before pulling the notepad++ (what could we hve done before there is notepad++) search literally for a copy of your string "</customattributes>" but here are the details for slow poke like me:
- The search gave me:
new 4 (44 hits)
Line 391: </customAttributes>
Line 419: </customAttributes>
Line 1045: </customAttributes>
Line 1051: </customAttributes>
Line 1080: </customAttributes>
- Clicking on one of the line will lead me to the ID of the WItype right on the next line: in my case clicking on 419 gave me line 420 <customAttributes category="com.ibm.team.workitem.bugType">, the WItype I had manually counted the # of custom attributes
- There are 626 lines between 419 and 1045, the latter of which is the line of the next found string.
- Hence besides line 420 there are 625 lines of "<customAttribute id" which are the number of custom attributes in that bug WItype. I had counted only 624 ... (Not going to loose my sleep over that missing one ... nor will I recount to match)
- All that can be verified by searching for "<customAttribute id" then verify that the search returned all the 625 consecutive lines from 421 to 1044 inclusively.
- ... Ah! I did count right, 624 lines from 421 to 1044, was just making a mental mistake and included 1045 in the group.
Not sure what was that noise after my first edit. It may return after I save this one
Don, that is amazing!!.. never had an editor that would return counts.. nice
Long,
I converted your "answer" to a comment, which it should be. And by some magic, the format became correct and I could read your comment properly.
Yes you are right, "<customAttribute id" gives you the right number, and "</customAttributes>" does not. I overlooked the "s" in the "customAttributes", which means that there can be multiple entries within this entity, and I made the wrong choice.
Nothing a night rest won't help discover if you sleep on it: Have not realized before that you can choose to search by regExp on notepad++
use search string "</customattributes>|<customAttributes category=" and voila, neatly arranged without having to manipulate in .xls or sort:
new 1 (88 hits)
...
Line 420: <customAttributes category="com.ibm.team.workitem.bugType">
Line 1045: </customAttributes>
...
hence for WItype bug there are (1045-420+1)-2 (for lines 420 and 1045)= 624
Out of neceessity, some regExp did not work as thought, found the simplest search strings:
"</customAttributes" for WItypes & their count of custom attributes
"</customAttributes*" for WItypes & their custom attributes
showing 5 of 6
show 1 more comments
Comments
sam detweiler
Nov 19 '14, 9:46 p.m.We'll you could write a little utility to count them.
long TRUONG
Nov 19 '14, 10:41 p.m.Thx Sam