Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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 ? 

0 votes



3 answers

Permanent link
 Hello Tommy,
I would use Default Provider - Script Based Default
Please refer to https://jazz.net/library/article/1003/

Hope it helps,
Eric

0 votes

Comments

 Hi Eric :

    Thanks for your response . I have tried Default value provider, but it only provide value when workitem is created.not everytime when I load the workitem. My requirement is to have a attribute which will be changed daily (system date), not only on creation time or save time, but on load (everytime when init workitem form value), any idea for that ?

 As per Ralph's input,

there is not OOTB solution for that.

Hold on a minute. What type of alert do you want?


If you just want to see items past some date, then you can easily use the dashboard for that, no need for calculated values or anything like that.

Or are you after some other sort of notification? 


Permanent link
There is no mechanism that calculates the value of a work item just because it is loaded. The value providers work on
  • Creating a work item
  • Changing a dependent attribute
  • Clicking on an attribute

I quite don't get the use case either.

0 votes

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
  • if delta <1 day returns red
  • if delta <3 day returns orange
  • return green
Would this work?

I moved the comment into a comment, that is why, probably.

I don't think this will work, because there is no triggering event that would change the calculated value. You also don't want that data always saved either.


Permanent link
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

0 votes

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)
star_enabled_and_disabled.png
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 

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

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954

Question asked: Nov 13 '14, 12:46 p.m.

Question was seen: 3,737 times

Last updated: Nov 17 '14, 2:11 a.m.

Confirmation Cancel Confirm