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

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.

0 votes



2 answers

Permanent link
You can do it through OSLC/REST
https://jazz.net/wiki/bin/view/Main/CqOslcV2

0 votes

Comments

Can we do it into DOJO script inside calculate value (Attribute customization) ?


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

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
× 10,935

Question asked: Mar 18 '15, 5:53 a.m.

Question was seen: 3,379 times

Last updated: Mar 18 '15, 6:44 a.m.

Confirmation Cancel Confirm