Create workItem programaticaly with mandatory fields set
Hi
currently I am using workitems.createAndLink from IworkItem to create and link to parent work ticket.
Now I want to make few attributes mandatory at first save( like uninitialed --> new state).
Is there method while create I can pass mandatory field values and then link that to parent work ticket.
I made few attributes mandatory by -- Operational behavior-->Save Work Item(server)--preconditions--> required properties.
because of these mandatory fields child is not gettig created.
I have set up RTC local server. In RTC -SDK I checked IworkItem class but I didnt find any method.
Please can any one suggest me.
Thanks,
Kavita
One answer
Kavita,
I am unable to find a IWorkItem.createAndLink() method in the API.
If you follow https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation and you are on the client you can use a WorkitemOperation to create (and modify) a work item. This is the best way I am aware of.
If you have required attributes you will have to pass the values to the operation and set the work item attribute values before you leave the operation which triggers the save.
With respect to the sate. setState2() is deprecated in 4.x. You are supposed to trigger a workflow action. As far as I can tell, you have to save for every action. The initial save will bring the work item into the new state.
You can find many hints and solutions to your questions above on http://rsjazz.wordpress.com/ and in the forums - you can search the forums either using its built in search or using a search engine.
I am unable to find a IWorkItem.createAndLink() method in the API.
If you follow https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation and you are on the client you can use a WorkitemOperation to create (and modify) a work item. This is the best way I am aware of.
If you have required attributes you will have to pass the values to the operation and set the work item attribute values before you leave the operation which triggers the save.
With respect to the sate. setState2() is deprecated in 4.x. You are supposed to trigger a workflow action. As far as I can tell, you have to save for every action. The initial save will bring the work item into the new state.
You can find many hints and solutions to your questions above on http://rsjazz.wordpress.com/ and in the forums - you can search the forums either using its built in search or using a search engine.