Script Based Validation can't prevent users saving workItem
Li Li (15●1●8)
| asked Mar 01 '17, 9:47 p.m.
edited Mar 02 '17, 3:31 a.m. by Ralph Schoon (63.3k●3●36●46) Hello,
|
Accepted answer
5 other answers
Ralph Schoon (63.3k●3●36●46)
| answered Mar 02 '17, 3:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Mar 02 '17, 3:37 a.m. My suggestions (this has worked for me):
Comments Also use the available constants for the built in attributes. These are available: https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of
So e.g. workItem.getLabel(WorkItemAttributes.OWNER)
Be sure to use the correct attribute ID's if not using the constants or for custom work item attributes - you can find them in the Administration WEB UI. The Eclipse UI unfortunately shows wrong ID's for the built in attributes.
|
As Ralph said, start with a simple script first, e.g. one that always returns Status.ERROR_STATUS. Once it is confirmed to work, you can then build it from there.
|
I change the test script like following ,it still can't prevent saving workItem.
Comments I find the error like the following in ccm.log
Ralph Schoon
commented Mar 03 '17, 3:05 a.m.
| edited Mar 03 '17, 3:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The script looks OK. Try to download the script file, make sure it is in UTF-8 format. I have seen errors like that because the encoding or something else created abnormal characters in the script. There might be other reasons. Is any of your scripts working? This has worked for me: /*********** * Licensed Materials - Property of IBM * (c) Copyright IBM Corporation 2011. All Rights Reserved. * * Note to U.S. Government Users Restricted Rights: |
I change the script to UTF-8,it still can't prevent saving workItem.In this projectArea some Script-based calculated values can be used normal when the script may show error like
|
I have removed the scripts which were not being used ,but the script based validation still can't prevent saving workItem;
|
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.