Attributes with script based calculated values - configuration
I am getting the following error and I presume my script needs to be somewhere it is not as indicated by the relative path in the error message. Where is that? I don't have easy access to my server so I am not familiar with the directory structure, but if I knew where to place my script I could put it there.
!ENTRY com.ibm.team.rtc.common.scriptengine 2 0 2013-04-01 16:21:43.224
!MESSAGE unable to find file: ./../com/ca/tools/Creator-valueProvider.js
2 answers
- Check that Process Attachment Scripts are enabled.
- Open the Project Area Editor in Eclipse and try to locate your script in the Links Tab in the Attachments section.
- Delete the scripts
- Upload them from the Workitem Customization section
You scrips should show up like in the image below.
Comments
did this, but no luck
Is " Enable Process Attachment Scripts" set to true in the Advanced Properties of the CCM Server?
Upload one of the example scripts for a string attribute e.g. calculated value.
Consider running through Lab 5 of https://jazz.net/library/article/1093 .
All I am trying to do is capture the Created By and Creation Date of a work item in another field. I tried using the example javascript from article 1003 and received NULL so that script example does not work. I added the debug/log statement, the only change.
Well, I an not the JavaScript expert, but I would consider If(creationDate) not to be a condition, especially since creationDate is a string value. So I'd suggest trying if(creationDate!=null) or if(creationDate!="") if you ever want to reach the statements in the if clause.
I have the javascript behaving properly now, but it is returning "creationDate" and not the actual value. My return statement looks like...
return WorkItemAttributes.CREATION_DATE;
any ideas?
David, you should really at least read https://jazz.net/wiki/bin/view/Main/AttributeCustomization and consider running through Lab 5 of https://jazz.net/library/article/1093 .
Right now you are returning the constant that would be used in a workItem.getValue(WorkItemAttributes.CREATION_DATE) to get the value you are looking for.
Which is confusing, because your original script screenshot actually shows the correct statement to get the value.
I now have my javascript returning a GMT formatted date string. I want to format it differently, e.g., Apr 10, 2013 5:36 PM
Any ideas?
You do not need to put manually any file to the server. It will be uploaded automatically.
I believe, that you have this error message in your .log file for Eclipse client. When exactly does this message appear in the log? When the value need to be used?
I believe, that it is worth of checking what is error message in ccm.log. You can use RSS feed to browse it if you do not have an access to the server.
You can try reloading and saving calculated value script again.
Comments
I get this immediately after the creation of a work item, ie. after I click OK to the type dialog.
Don't know how to setup the RSS feed for CCM.log
Hi David,
Try this one to see your ccm.log as a feed: https://example.com:9443/ccm/events
I would rather suggest reading https://jazz.net/library/article/1093 and discover where the logs are really located (ccm.log does not provide ANY information about executing JavaScript at all), make sure scripting is enabled and try a basic downloaded example script.