How to save workitem through DOJO programming language?
I have added one check box in Workitem and would like to save the workItem automaticaly without press the save button on the workItem UI. Please guide me.
|
2 answers
You can do it through OSLC/REST
https://jazz.net/wiki/bin/view/Main/CqOslcV2 Comments
Vikash Singh
commented Mar 18 '15, 6:24 a.m.
Can we do it into DOJO script inside calculate value (Attribute customization) ? |
dojo.require("com.ibm.team.workitem.web.cache.internal.WorkItemProxyFactory");
var newProxy = WorkItemProxyFactory.getWorkItemProxy({createIfNeeded: true}); newProxy.initialize({projectAreaItemId: "paID", type: "com.ibm.team.apt.workItemType.story", newWorkItem: true, includeHistory: false}); //Set attributes newProxy.object.attributes.summary.content = nSummary; newProxy.object.attributes.category.id = nCategory; newProxy.object.attributes.target.id = nTarget; newProxy.storeWorkItem({ self: this, operationMsg: "Saving", applyDelta: true, //instigator: this, onSuccess: function(param) { setTimeout(dojo.hitch(this, function() { this.self.viewlet.refresh(); //Release cursor dojo.query(".class", this.self.viewletNode.id).style({ "cursor": "default", }); dojo.query("body")[0].style.cursor = "default"; }), 1000); } }); Maybe this will help you. Read the article, and you'll get the Idea of the WIProxy |
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.