It's all about the answers!

Ask a question

If Timespent attribute in not null then status/state should change automatically to inprogress? is it possbile by script or any other way?


Sunanda Kalthireddy (15311) | asked Aug 14 '17, 5:14 a.m.

 i have a attribute in task wi that is Timespent . if timespent is not null means if it contains any values, status should change inprogress automatically . is it possible ?


i use below script but it doesn't work

dojo.provide("com.example.Condition");

dojo.require("com.ibm.team.workitem.api.common.Severity");
dojo.require("com.ibm.team.workitem.api.common.Status");

(function() {
    
    
    dojo.declare("com.example.Condition", null, {

    getValue: function(attributeId, workItem, configuration) {
var Status1 = com.ibm.team.workitem.api.common.Status;
var timespent1 = workItem.getValue(WorkItemAttributes.TIME_SPENT);
        
if(timespent1!= null)
        return new Status1("Start working");
 }
});
})();

please suggest me the solution.

One answer



permanent link
Ulf Arne Bister (1.3k413) | answered Aug 14 '17, 8:48 a.m.

It seems you attempt to use attribute customization scripts. These can only be used for calculating attribute values or validation attributes. Work item state is not simply an attribute value you could modiy like this.

See also: https://jazz.net/library/article/1003

The best way to accomplish this is a server side operation advisor script.
This would have to be written in Java, deployed to the server and would trigger on work item save, changing state if time spent <> null.

You can either attempt to write this yourself (cp. https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/) or (shameless self-advertisement) turn to e.g. Method Park for the RTC-Integration plugin that would easily allow scripting this.

If this is helpful please mark the answer as accepted.

- Arne


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.