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

Condition scripting String List Type issues

EDIT: It seems that the reason causing this was the differences between the JavaScript engine on the browser and the JavaScript engine running on the eclipse client and the ccm server.


Hello,
     I am trying to write a condition script that will make a String List required when a checkbox in an Enum list is selected. For example, the user selects "ticket reported by external customers" checkbox in the Customer issues attribute Enum List.  When this box is selected it will cause the Attribute "Customer names", which is of type String List, to become required, and will require that at least one string is inside of the string list. 

     Currently in the web UI, when I select "ticket reported by customer", the red asterisk appears next to the "Customer names" attribute, however I am allowed to save the defect with no values in the string list.  I have other condition scripts running so I am pretty sure that the condition script is set up properly. I also notice that in the eclipse client, the red asterisk for required does not appear for the field "customer Names" when I select "ticket reported by external customers" like it does in the web UI. I have added the "customer names" into the Required Attributes for type and state for testing purposes and when there are no values in the string list the server throws an error "Attribute 'Customer Names' not set. the 'Customer names' attribute needs to be set (work item 100)."  so I know that there is a way for the server to check if requirement based off of the values inside the string list.  Is it currently not possible to make a string list a required field using condition scripting, or am I missing something.  Thank you very much.

0 votes


Accepted answer

Permanent link
Debug your script in Eclipse as well, as the JavaScript engine in Eclipse can behave differently to your browser. When you use RTC Eclipse client, or when the script is evaluated on the server side, it's the Eclipse JavaScript engine at work. If the RTC Eclipse client does not flag the attribute as required, you can expect the CCM server (also based on Eclipse) will do the same thing.

The JavaScript console.log() function output will appear in the Eclipse .log file. For CCM Server, you can find the .log file under tomcat/work/Catalina/localhost/ccm/eclipse/workspace/.metadata/.log if using Tomcat.
Timothy Esau selected this answer as the correct answer

0 votes

Comments

It seems to be the case that the JavaScript engine running on the eclipse client, as well as the server is very much different than the JavaScript running in our browser.  After looking at he logging, many of the methods that were working in the browser were behaving differently eclipse client side, which is what was causing the discrepancies.

2 votes


One other answer

Permanent link
Conditions don't prevent from saving if
  • The operational behavior is not configured
  • The severity is not error

JavaScript has issues with List types, I think you should get a string. Not sure.

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

Question asked: Jun 01 '15, 5:12 p.m.

Question was seen: 2,607 times

Last updated: Jun 03 '15, 9:53 a.m.

Confirmation Cancel Confirm