Setting default values for Timestamp Custom Attribute
Hi everyone.
I've spent some hours with this issue and I haven't been able to find a solution, so I hope to find help in this forum :) I've declared a custom attribute with a script-based default value, returning the current date. So far so good. Then, in my work item presentation I've inserted two fields: one of them is text-based, and the other one, a Timestamp. Both of them get their default values from the same attribute and the same script, but when I create a new Work Item, the text-based field displays the default value properly (a string with the current date), but the Timestamp shows the string 'None', and it's still needed to pick a Date to fill the field. Does anyone know how to set a default value to a Timestamp presentation? Thanks in advance. Dani G. |
10 answers
Ralph Schoon (63.5k●3●36●46)
| answered Oct 25 '11, 11:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Dani,
I tried several formats and I will most likely look into the work items if this is known. If not I will create an enhancement request. The wiki states it should work. Please note also the wiki states that certain things don't work. Contributors don't work either. |
Hi,
We need to set the Time in milliseconds for the TimeStamp attribute. hence, the following statements should work.
Comments
Pavithra Kasturirangan
commented Aug 06 '12, 8:34 a.m.
Thank you for your help.... I got that working !!! |
Ralph Schoon (63.5k●3●36●46)
| answered Oct 25 '11, 8:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Daniel,
I followed https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Default_values to do the same. My code looked like:
Unfortunately I have the same effect as you describe in the default value provider. The Eclipse client log shows the error below and I assume this is a bug in the experimental Javascript engine:
|
Hi, Ralph,
Thank you for answering. It seems that Timestamp container has an odd behavior dealing with customization. At least, now I know that it isn't only me :) I'll continue looking for a solution (or at least, a workaround), and if I find it, I'll post it in here. Thanks. Dani. |
Hi, Ralph,
Ok then, I was going crazy :) Thank you so much for your help. Regards. Dani. |
Ralph Schoon (63.5k●3●36●46)
| answered Oct 27 '11, 12:59 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Daniel,
just to let you know, there was a work item for it and it is fixed - I checked default value provider - in 3.0.1.1. Comments
Gowra chandra varma
commented Jul 19 '12, 3:34 a.m.
Hi Ralph, Thanks for the above script on default value: current date I have a requirement to set default value of "to_date" attribute (time stamp) as 15th of current month& year. with ur script i was able to get default value as current date, but Pls let me know the modification which i need to make in script to "mask the day with 15" and pass result. !ENTRY com.ibm.team.rtc.common.scriptengine 1 0 2012-07-19 12:31:51.125 !MESSAGE LOG: Now is: 2012-07-19 T07:01:51.123Z This log shows the result as current date. my requirement is to mask 19 with 15 and pass the result.
Pavithra Kasturirangan
commented Aug 06 '12, 4:57 a.m.
Hi Ralp, Im using RTC 3.0.1.3 but i still have the same difficulty mentioned above in writing the date value to the workitem. My script is able to fetch it properly, but unable to write it to the workitem due to" java.lang.NumberFormatException: For input string" |
Hi, Ralph.
Thanks for your help. I'll try installing 3.0.1.1. Regards. Daniel Garcia |
I'm using RTC 3.0.1.3 server and client. I get the same error mentioned above while trying to return the date value.
Can anyone help me on how to fix this ?
|
Hi Ralph,
I'm using Calculated Value (RTC 4.0 RC0) for a timestamp attribute and have the same problem when the workitem is created. On following actions (i.e. change state, change attribute value, etc.) it works fine.
Any idea?
amit.
|
Ralph Schoon (63.5k●3●36●46)
| answered Aug 22 '12, 10:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Aug 22 '12, 10:03 a.m.
Amit, I don't have an idea. I didn't see the posts above, probably due to the conversion to the new format. Unfortunately I have no time to look into this right now.
|
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.