It's all about the answers!

Ask a question

Attributes with script based calculated values - configuration

David Murphy (11143) | asked Apr 01 '13, 4:49 p.m.
edited Apr 02 '13, 3:51 a.m. by Ralph Schoon (63.2k33646)

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 2 0 2013-04-01 16:21:43.224
!MESSAGE unable to find file: ./../com/ca/tools/Creator-valueProvider.js

2 answers

permanent link
Ralph Schoon (63.2k33646) | answered Apr 02 '13, 4:00 a.m.
Another thing you can try is.

  1. Check that Process Attachment Scripts are enabled.
  2. Open the Project Area Editor in Eclipse and try to locate your script in the Links Tab in the Attachments section.
  3.  Delete the scripts
  4. Upload them from the Workitem Customization section

You scrips should show up like in the image below.

David Murphy commented Apr 02 '13, 11:05 a.m.

did this, but no luck

Ralph Schoon commented Apr 02 '13, 11:11 a.m.

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 .

David Murphy commented Apr 09 '13, 3:10 p.m. | edited Apr 09 '13, 3:11 p.m.

Javascript example that does now work 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.

Ralph Schoon commented Apr 10 '13, 2:17 a.m.

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.

David Murphy commented Apr 10 '13, 10:17 a.m.

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?

Ralph Schoon commented Apr 10 '13, 10:22 a.m. | edited Apr 10 '13, 10:33 a.m.

David, you should really at least read and consider running through Lab 5 of .

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.

Ralph Schoon commented Apr 10 '13, 10:35 a.m.

Which is confusing, because your original script screenshot actually shows the correct statement to get the value.

David Murphy commented Apr 10 '13, 5:37 p.m.

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?

showing 5 of 8 show 3 more comments

permanent link
Krzysztof Kaźmierczyk (7.4k475103) | answered Apr 02 '13, 3:17 a.m.
Hello David,
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.

David Murphy commented Apr 02 '13, 11:04 a.m.

 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

David Murphy commented Apr 02 '13, 3:20 p.m.

RTC Error Log

Krzysztof Kaźmierczyk commented Apr 03 '13, 2:35 a.m.

Hi David,
Try this one to see your ccm.log as a feed:

Ralph Schoon commented Apr 03 '13, 6:20 p.m.

I would rather suggest reading 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.

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.