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

Question regarding work item script automatic refresh

 Hi 

I have created the below sample script to change the "reaction enumeration" as soon as the Due date reaches. The script is working fine but the problem is it will not get updated unless one or more attributes are changed and saved. 

Is there any process through Java script to automate the process rather than making the changes and saving manually ??

dojo.provide("Reaction");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date");
dojo.require("dojo.date.stamp");
(function() {
    dojo.declare("Reaction", null, {
        getValue: function(attribute, workItem, configuration) {
    var currentDate = new Date();
    var DueDate = dojo.date.stamp.fromISOString(workItem.getValue("Due Date"));
    var DueDiff = dojo.date.difference(currentDate,DueDate,"day");
               if (DueDiff>=0)
    {
return "Reaction.literal.l2" ; 
}
return "Reaction.literal.l4" ; 
}
} );
} ) ();

0 votes



One answer

Permanent link

There is nothing built into the tool. It is possible to create such kind of automation, however I suspect this is some of the many customization attempts that should not be done, because there are other means available to achieve the same.

So the question here is, what is the purpose and why is that important for the business?

0 votes

Comments

1)  The need is with a prjct whch hve sme RTP dates. Once the RTP date reaches project status attribute must be set to WR (Under warranty) the same thing is with RTP+30 days when the project status will change to closed. Another issue is associated task i.e. as soon as all associated tasks will be completed associated parent should achieve a certain status. I hve seen if i am not wrong some of ur post rgrdng ths conceptually i agree but these r d team need at the moment. I have seen the below post but its through API : https://rsjazz.wordpress.com/2012/11/27/resolve-parent-if-all-children-are-resolved-participant/

The API and some tough customization is the only way to do this.
No work item system I am aware of has such background jobs that changes the data.
In reality you would basically use queries and show the work items that qualify for RTC+30 etc. You would not change the items, you would show query results. I have posted the API to change states and the like in my blog you mention, but that does not mean that I am a fan of some of the automation, in fact I am not. When work items start changing their own state, the state is meaningless and should not be there.

There is nothing even remotely in the tool that will allow configuring this kind of stuff. You will in any case use the server or client API to run queries to find the work items, to change them etc.

 Thanks Ralph. I appreciate the justification provided. I will check with the team will it be worth the effort to invest so much of time and high end customization.

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
× 6,121

Question asked: Aug 16 '17, 8:45 a.m.

Question was seen: 2,006 times

Last updated: Aug 24 '17, 9:41 a.m.

Related questions
Confirmation Cancel Confirm