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

Problem with Wokflow graph in RTC

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";

        }

0 votes



3 answers

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

0 votes


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

0 votes


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

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

Question asked: Dec 12 '16, 5:30 a.m.

Question was seen: 2,614 times

Last updated: Dec 12 '16, 6:51 a.m.

Confirmation Cancel Confirm