It's all about the answers!

Ask a question

workItem.categoryName in an email template

Ratheesh Madathil (1371829) | asked Jun 11 '14, 4:50 a.m.

In the email template, by using the "workItem.categoryName" you get the "filed against" value inserted in the email.

If we have sub categories under a main category, in there a way to get the "Filed Against (Top Level)" in an email which is generated from RTC.

Currently by using workItem.categoryName it just shows the sub category, but we like to have the top category (or parent..)

Geoffrey Clemm commented Jun 11 '14, 9:50 a.m.

Just for interest's sake, why would you want only the top level category in the email?

Ratheesh Madathil commented Jun 13 '14, 6:06 a.m.

I can explain that.
We have the major categories visible for all, so that all users can select and raise their issues against a specific category. Then we have sub categories used by team internal to manage the work items after they received it. These sub categories are visible to the team only, normally it is technical or component based categorization of the teams product.
Hope that clarifies, we like to have the mails with the main category for getting the context easily. (sub category like I mentioned is really team specific, not all will understand,  not good for sorting etc..)

One answer

permanent link
Arne Bister (2.6k12832) | answered Jun 13 '14, 10:08 a.m.

as the top level category is not persisted in the work item by default (just the actual "filed against" in the workItem.categoryName) the email mechanism would not have anything to retrieve and parse.
I looked at the Email Wiki and also the used language VLT but that does not seem to provide any mechanism to parse more info. So the only viable solution I currently see (aside from filing an Enhancement Request to have workItem.categorypath be included as a List of the category hierarchy) would be:
- introduce a custom attribute in your work item, but do not expose it on the Editors
- make this dependant on changes of Filed Against
- when Filed Against is changed, it will be parsed to stuff the "top level category) into that hidden custom attribute

Then you can use that custom attribute in your email template as per the wiki.

Would this be an acceptable approach? If this answers your question, please mark it as accepted.


Ratheesh Madathil commented Jun 16 '14, 7:50 a.m. | edited Jun 16 '14, 7:51 a.m.

Thanks Arne for the information.

We had already looked in to the Wiki which you mentioned....

I like that work around, but I was looking for a more straight forward solution if that is available.

Especially, given that we have in all widgets and queries the possibility to select "filed against (top level)" as an input,  it should be some how much more easily possible.

Does anyone else has another view point to it?

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.