It's all about the answers!

Ask a question

Question regarding work item script automatic refresh


Nitin Kaushik (11118) | asked Aug 16 '17, 8:45 a.m.

 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" ; 
}
} );
} ) ();

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Aug 16 '17, 9:00 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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?


Comments
Nitin Kaushik commented Aug 16 '17, 9:10 a.m. | edited Aug 16 '17, 9:26 a.m.

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/


Ralph Schoon commented Aug 16 '17, 10:11 a.m. | edited Aug 16 '17, 10:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Nitin Kaushik commented Aug 24 '17, 9:41 a.m.

 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 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.