How to initialize the value everytime when loading a workitem ?
![]()
I'm trying to init value (calculated script based) when loading workitem. but it will always be triggered when I save workitem. I plan to have a custom attribute which has the calculated script value (System date - Due Date). I would like it change everyday when I load (open) the workitem without modification. . but the value is always the same when day passed since I don't have any modification. Any suggestion for doing this feature ?
|
3 answers
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Nov 14 '14, 8:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
There is no mechanism that calculates the value of a work item just because it is loaded. The value providers work on
I quite don't get the use case either.
Comments Hi Ralph :
Customer use case is that they want to add a attribute which is "system date -due date" , called alert indicator.
When alert indicator <=3 , then display red color nearby the filed. This is reminding their users to finish their task asap.
Any other ways to fulfill their requirement ?
Correct Tommy,
sorry - for some reason - my last update was added to your comment.
I would use a js calculated attribute.
1 - overdue indicator attribute - overdue (3 values - green / orange / red)
2 - calculated value : due date - current date
I moved the comment into a comment, that is why, probably.
|
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Nov 14 '14, 8:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The only viable approach I am aware of would be a custom non attribute based presentation. See https://jazz.net/wiki/bin/view/Main/ContributingAttributePresentationsV2
Comments Hi Ralph :
I just look through the link about the ContributingAttributePresentationsV2 , I found that the "star" presentation will display based on the attribute value(true/false)
![]()
But when will the "star" show up ? When Loading workitem ? or when you just save or editing the attribute value change?
When loaded. But that IS the presentation of this attribute ![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
My assumption is, you can add a presentation e.g. based on the due date and then, when it gets loaded and the UI displays the attribute, calculate its presentation based on the attribute and the current timestamp.
|
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.