It's all about the answers!

Ask a question

How to replace work item type value with a different value


Michael Oyebola (31114) | asked May 19 '16, 11:49 a.m.
edited May 19 '16, 1:56 p.m.
Hi,
I would like to replace the "Type: Task" to "Type:TSK" in my email template subject. This is my idea below:
<script>
function myFunction() {
    var task = "TSK";
    var Defect= "DFT";
}
</script>
#if(${workItem.type} == "Task") myFunction(Defect) #end

My main goal is to make my work item type an abbreviation on my subject content. I also tried the following below but i got an error message:
Type:          ${workItem.type.abbreviation}

any responses would be helpful. Thanks




Comments
Ralph Schoon commented May 20 '16, 3:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I don't understand in which context the above code is supposed to run.


sam detweiler commented May 20 '16, 9:01 a.m.

he said email template.. which is Velocity

I don't think workitem.type HAS an abbreviation member.  so you should get an error

I don't think there are user functions in Velocity... but you might be able to use a macro

https://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html

Be the first one to answer this question!


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.