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

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

 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.

0 votes



One answer

Permanent link

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


0 votes

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,019
× 7,495
× 1,700

Question asked: Aug 14 '17, 5:14 a.m.

Question was seen: 3,077 times

Last updated: Aug 14 '17, 8:48 a.m.

Confirmation Cancel Confirm