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

Fetch selected literal value in enumeration list through script

 Hi,

I have created an enumeration list of type radio button. Now i want to fetch the value of the radio button selected, through javascript.

How can i fetch the value of selected radio button(literal) through script?

Thanks in advance.

0 votes



2 answers

Permanent link
Amit, please get https://jazz.net/library/article/1093 and go through Lab 5. Especially read the section about what JavaScript can do and can't.

You can access the data using getValue() which returns the enumeration literal as string or getLabel() which returns the display text of the literal as text.

0 votes

Comments

And make sure not to confuse concepts. You probably created an attribute of type enumeration and you created an editor presentation for that attribute that shows the selected value as radio button.

Hi Ralph,


Thanks for your reply.

i want to retrieve value of only selected literal, so how can i get the selected literal value?

The script can only access the values assigned to the attribute - the ones selected. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization or  https://jazz.net/library/article/1093 Lab 5.


Permanent link

 hello team,


I created two attribute one is attribute type enumeration having name "task status" below are the task status list:
Un-Assigned (Deafult),
Work In Progress(WIP),
On-Hold,
Completed,
Abandoned,
Rework,
Rework Completed
and another attribute type is timestamp having name "actual start date". now the thing is that whenever user select Task status as "Work in progress(WIP)" then actual start date set by current date and time.

for this I create script using value-set but its not working
My script is:

dojo.provide("org.example.workitems.providers.Actualstartdatescript");

dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.string");

(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

dojo.declare("org.example.workitems.providers.Actualstartdatescript", null, {

    getValueSet: function(attributeId, workItem, configuration) {
    
var actual_sd=workItem.getValue("actusl");
var TaskStatus=workItem.getValue("task_s");
        if(task_s=="Work In Progress(WIP)")
{
return actual_sd.Date.now();
}
else
{
return "";
}
return actual_sd;
    }
});
})();

I think this code is wrong please correct me.

and also I went through many of the solution but I am confused about how to get one particular value or selected value from enumeration and then assign that to actual start date by script.



thanks in advance
sayli

0 votes

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
× 10,935
× 152

Question asked: Feb 11 '13, 4:03 a.m.

Question was seen: 7,764 times

Last updated: Mar 03 '17, 7:43 a.m.

Confirmation Cancel Confirm