It's all about the answers!

Ask a question

Get a value from attributes to be used in a script in eclipse editior


Jeff Piontek (134) | asked Apr 25 '16, 9:41 a.m.

 Hello I'm trying to write a custom script for the attribute customization that uses a custom risk attribute and the built in severity to  determine the priority in a defect work item. I am able to retrieve the label and value from my risk attribute find but not the built in severity or priority. If I use the get value command with those two attributes nothing outputs to the log, if I use the get label the console just returns null. I need to take both values in in order to compare them to define my priority.

Here is the command I'm using for the script to log the values in the console log.

  try{
   var risk = workItem.getLabel("risk");
   console.log(risk);
   
   var severity = workItem.getValue("com.ibm.team.workitem.attribute.severity");
   console.log(severity);
   
   var priority = workItem.getValue("com.ibm.team.workitem.attribute.priority");
   console.log(priority);
     }

Thanks for any help
  

Accepted answer


permanent link
Ralph Schoon (63.3k33646) | answered Apr 25 '16, 10:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 25 '16, 11:05 a.m.
You have to use the Web UI to find the attribute ID. The Eclipse client unfortunately shows some external ID's. This is a bug and reported. The Web UI Project Area Management shows the real ID's used by attribute customization.

For example "internalSeverity" and "internalPriority"


Jeff Piontek selected this answer as the correct answer

Comments
Jeff Piontek commented Apr 25 '16, 10:51 a.m.

Thank you very much that solved the issue for me, I appreciate the help.

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.