Script is not working in web ui, In eclipse working fine
Hello All,
I implemented simple script but it is not working in WEB UI, In eclipse it is working fine.
I took attribute of pushedValue and multiselect of type "medium string". which can select multiple values from the list.
When we run the script then it is working in eclipse but not in WEB.
Can any one know why reason of this issue .
|
6 answers
I don't spot anything that would work in Eclipse only but not in a browser. If it fails, it should fail in both cases. When you step through SplitedString[], you start at 1 (instead of 0), and stop before length-1 (instead of length), is it by mistake or intentional (assuming the first and last elements need to be filtered out)?
Also, it's mentioned many time on this forum - elaborating what "is not working" means goes a long way for others to help you. P.S. The variable pushedValue never gets used in the script. Why? Comments Hi Donald,
Thanks for your reply.
About SplitedString[] gives the output like [,"block ","EDZ ","GP ",]
0th and last value of array is blank ""/null.
pushedValue varible is not used in the script.
I am trying to implement if I select the block and EDZ from string list type of attribute (multiselect attribute) then in other string list type attribute/ medium string/ in enumeration I want all the values which are defined in array of block and EDZ.
I implemented and tested in eclipse. It gives the exact result as per the requirement but in web ui in it gives blank data. Tested in all browser.
Thanks & Regards
sam detweiler
commented Jun 17 '16, 8:25 a.m.
so, add some logging and see what is different when using the web UI.
|
Ralph Schoon (63.3k●3●36●46)
| answered Jun 17 '16, 8:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please see https://rsjazz.wordpress.com/2016/06/17/javascript-attribute-customization-where-is-the-log-file/ to find the log files and for the hints for using a debugger.
Comments
Anurag Patel
commented Jun 20 '16, 3:23 a.m.
Hi Ralph,
I check .log file in eclipse metadata folder. It is not showing any error.
However found one error in browser while debugging :
Errror : ?include=D~&etag=F2mgQBZMdty_en_GB&_proxyURL=%2Fccm&ss=Iyg0p&locale=en-gb:22045 Uncaught Error: com.ibm.team.repository.web.transport.ServiceRequest(): invalid requestParameters parameter: [object Object]
Donald Nong
commented Jun 20 '16, 3:35 a.m.
Use console.log() to get more detailed information. For example, print out the string before and after split.
Anurag Patel
commented Jun 20 '16, 4:20 a.m.
Hi Donald,
I tried with same using console.log() and also alert(), but when we debug it in browser then the control is not going to the script and also it is not showing the printed values using console() and alert() method and gives the above mentioned error.
While if I do it same in eclipse using console.log then it shows the correct values and script also working fine.
Thanks
Did you use ?debug=true and did you follow the link to understand the log locations?
Anurag Patel
commented Jun 20 '16, 6:07 a.m.
Yes Ralph I tried by using ?debug=true in url.
Also checked the .log file on server and found that values are not coming for the attribute "multiselect " attribute. So that "SplitedString" values also null.
But in eclipse these values are coming for both the attribute. Why facing this issue? Did you have any idea to resolve this problem.
I don't have an idea why your script fails, however,
showing 5 of 6
show 1 more comments
|
Hi Ralph,
Thanks for reply.
"Multiselect" attribute information :
Attribute Name : Multiselect
Id : com.ibm.team.workitem.attribute.multiselect
Type : String List
this attribute shows the list of data as : block, EDZ, GP, etc
You can select multiple data same time.
I separated the data from attribute "Multiselect" and stored into array of name "SplitedString" of attribute.
But problem is that when I select the multiple values from Multiselect attribute, and try to read the data it shown null data. And if run same script in eclipse then this data is coming in eclipse. it shows the data in Multiselect as well as in SplitedString of attribute.
I am trying to read more than one value from the attribute.
|
Ralph Schoon (63.3k●3●36●46)
| answered Jun 20 '16, 7:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
It is widely ignored but https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript states the work item attribute types that are supported. And it does NOT mention lists at all.
So from my perspective list attribute types such as stringList or other list types are not supported. So you are lucky you get something in Eclipse, but that does not necessary mean that this is supposed to work that way everywhere. |
Hi Ralph,
Thanks for the reply.
My requirement is that,
In Task workitem there is one attribute (with name Project Name) which contains the project list like block, EDZ, GP etc.
User can able to choose multiple values from "Project Name".
Below is the data related to Projects:
Projects List : block, EDZ, GP
Dependent values on projects :
Block = block-1, block-2, block-3, block-4, block-5;
EDZ = EDZ-1, EDZ-2, EDZ-3, EDZ-4, EDZ-5;
GP = GP-1, GP-2, GP-3, GP-4, GP-5;
If user can select the Project Name Block and GP then there should be other attribute which will show the combined values of only selected projects (related to Block and GP) like block-1, block-2, block-3, block-4, block-5, GP-1, GP-2, GP-3, GP-4, GP-5
It should not show the values related to EDZ because EDZ is not selected in Projects.
Do you have any other solution which will implement above mentioned logic.
If yes then please suggest the attribute type which will select multiple values from the attribute and how to make dependency for Project Name and their dependent values.
|
Ralph Schoon (63.3k●3●36●46)
| answered Jun 20 '16, 8:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If you need more access to the work item API than the JavaScript API provides, you can look into https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ . This API is less limited. In some cases a follow up action that calculates and sets the values might be valid as well.
I can not provide you with more than this guidance. |
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.
Comments