Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to replace work item type value with a different value

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



0 votes

Comments

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

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: May 19 '16, 11:49 a.m.

Question was seen: 808 times

Last updated: May 20 '16, 9:01 a.m.

Confirmation Cancel Confirm