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

How to set an attribute based on the time WI is loaded?

Hi guys,


I created an attribute and I would like to fullfill it with the time that workitem is loaded using "Script Based Vale Set". Does anybody knows if is it possible?

When we open, update or refresh the workitem, the information of the time that the WI is loaded appears in the page as presented below:

Can I use this information in my script? Maybe some internal field can return this information....any ideas?

Since now, thanks for any tip.

Luiz Cesar.

0 votes


Accepted answer

Permanent link

I believe you are thinking of a "script-based calculated value", not a "script-based value set.  But that doesn't help, because changes to the calculated value are triggered by a save of the work item, not by a "load" of the work item (I assume by "load", you mean when the work item is retrieved from the server via a GET call).

And you shouldn't try to do this anyway, because that would result in a write to the database for ever work item that is read from the server, which would flood the database with write transactions.
What is the use case you are trying to address?   Perhaps there is a more reasonable way of achieving it.

LUIZ DE ALMEIDA selected this answer as the correct answer

0 votes

Comments

Geoffrey,

Sorry for the late, but what I was trying to do was to show the time a workitem was in a status. I've created an attribute that records the time the workitem has the status changed. So, If there was a way to figure out the time when the workitem was loaded, I could calculate "time_workitem_loaded" minus "time_status_changed", then I would have the time the workitem is in the status.
Did you understand me?


One other answer

Permanent link

Did you even read the answer? An attribute customization using what the basic JavaScript attribute customization allows will NOT work.
Here is an approach that works for the Web UI, dependent on the requirements: Custom RTC work item presentation showing the state history.

1 vote

Comments

BTW, this should also be possible with Report Builder, if you like to have a report showing how long a Work Item was in a particular state.

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
× 12,023
× 7,499

Question asked: Nov 22 '17, 3:16 p.m.

Question was seen: 1,890 times

Last updated: Dec 18 '17, 4:35 p.m.

Confirmation Cancel Confirm