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

[RTC] Is it possible set different default value for enumeration item according to the workitem type

 we have a request for RTC configuration. We defined an enumerations item priority, and set the default Literal as medium. Then set priority as one attribute of all the workitems. Our request is, when new a defect, the default value of priority keep the default Literal: medium; but when user story is created, the default value of priority will be set as critical. Is that possible to realize by defining a Default Value in Attribute Customizaton?

I have some attempts:
1.In Process Configuration tab, Work Items->Attribute Customization
Create default value: Type Based DefaultPriorityValue
Provider: Script Based Default
Script:
dojo.provide("bpm.agile.DefaultPriorityValue");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("com.ibm.team.workitem.attribute.priority");

(function() {

var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
var priority = com.ibm.team.workitem.attribute.priority;

dojo.declare("bpm.agile.DefaultPriorityValue", null, {

getDefaultValue : function(attribute, workItem, configuration) {
var type = workItem.getValue(WorkItemAttributes.TYPE);
if (type == "com.ibm.team.apt.workItemType.story"){
return priority.literal.l4
}else{
return priority.literal.l2
};
}
});

bpm.agile.DefaultPriorityValue

})();

2. Go to configuration Data -> Work Items -> Types and Attributes
3. Select the User Story work item type and select Priority in the list of attributes
4. Edit the attribute and select Type Based DefaultPriorityValue for the default and save.

It doesn't work. Is it possible to realize our request? Any problem with my way? Hope your help. Thanks in advance.

0 votes



One answer

Permanent link

A literal is a string, return "priority.literal.l2";

0 votes

Comments

 Thanks, Do you mean I should change return priority.literal.l4 to return "priority.literal.l4"?

It does not work, too.

Your answer

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
× 6,168

Question asked: Aug 27 '20, 6:48 a.m.

Question was seen: 2,901 times

Last updated: Aug 27 '20, 8:26 a.m.

Confirmation Cancel Confirm