It's all about the answers!

Ask a question

Problem with Wokflow graph in RTC


vinitha dsouza (147223136) | asked Dec 12 '16, 5:30 a.m.
edited Dec 12 '16, 6:51 a.m. by Ralph Schoon (63.5k33646)
Hello team

I am using a Script based value set called " WorkflowGraph" , The link of the workflow script is not appearing in the Defect WI. But if i change the Process sharing into another template and then switch back again to the current template then its appearing again ...Could you please Let me know what is going wrong

Many thanks in advance :)


getValue: function(attribute, workItem, configuration) {
        debug("Start");
       

var workflowType = workItem.getValue(WorkItemAttributes.TYPE);

        var workflowState = workItem.getValue(WorkItemAttributes.STATE);

        if(workflowType == "defect") {
return "https://inside-docupedia.bosch.com/confluence/download/attachments/359083805/Defect_0.2.jpg";

        }

3 answers



permanent link
Ralph Schoon (63.5k33646) | answered Dec 12 '16, 5:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The Script is syntactically incorrect. It does not always return a value. Such a Script has to always return a value. Then if this is the script, it is also missing various other parts such as defining WorkItemAttributes.

permanent link
vinitha dsouza (147223136) | answered Dec 12 '16, 6:10 a.m.
Hello Ralph @Ralph Schoon

You can refer the whole  below script which i am using .. It was working fine before....But sometime back i found that there was no workflowgraph loaded in Defect WI .Then i switched back to the old process provider then again to the current
Process provider ,Then it started working
But i am unable to find the root cause

dojo.provide("com.example.rtc.js.client.workflow.formal");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");



(function() {
    var doDebug = true;
    var scriptname = "WorkflowGraph";
    var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;

    dojo.declare("com.example.rtc.js.client.workflow.formal", null, {

        getValue: function(attribute, workItem, configuration) {
            debug("Start");
           
       
            var workflowType = workItem.getValue(WorkItemAttributes.TYPE);
            debug("workflowType: " + workflowType);
            var workflowState = workItem.getValue(WorkItemAttributes.STATE);
            debug("workflowState: " + workflowState);
           
            //return workflowType + " " + workflowState;
           
            if(workflowType == "defect") {
            return "https://inside-docupedia.bosch.com/confluence/download/attachments/359083805/Defect_0.2.jpg";
           
            }

else if(workflowType == "com.ibm.team.apt.workItemType.story") {
                return "https://inside-docupedia.bosch.com/confluence/download/attachments/359083805/Story_0.2.jpg";
                   
            }
           
           
            return "Workflow type '" + workflowType + "' unknown.";
           
            function debug(display){               
                if(doDebug){
                    console.log(scriptname + " " + display);
                }
            }     
        }
    });
})();

permanent link
Ralph Schoon (63.5k33646) | answered Dec 12 '16, 6:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
It is impossible, from the script and the description you provide, to answer your question. You may want to contact support. Support can ask for log files etc.

PS: if you return the calculated value into a string or HTML attribute, then I would not expect the link to work or automatically display an image. Automatically displaying an image as explained in https://jazz.net/library/article/1093 at the end of lab 5 only works with attributes of type wiki and the image is attached to a work item as described in said lab, as far as I know. 

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.