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
Ralph Schoon (63.5k●3●36●46)
| answered Feb 13 '13, 8:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Feb 13 '13, 8:36 a.m.
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. Comments
kavita herur
commented Feb 14 '13, 8:18 a.m.
Thanks,Ralph I am trying in process configuration code changes in enctment section. How do I check the other methods like createWorkItem() and what parameters should be passed. Is it RTC Plain Java client library need to be set in RTC eclipse client?
Ralph Schoon
commented Feb 14 '13, 8:41 a.m.
| edited Feb 14 '13, 8:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I am not sure I understand your question. You can download the JavaDoc for the plain Java Client libraries. You can use the Plain Java Client Libraries in Eclipse as well. The best way to set this up is
Now you have the best of both worlds, you can use the PDE and Java search to search the API, code completion works and you can still run or debug it using a main method in Eclipse. I think I explained a bit in https://jazz.net/library/article/807
I shall blog about it. Unfortunately I have not time now.
Thanks, Ralph I have RTC SDK and PlainJava API set up in eclise. Actualy in process configuration source code in <enactment > section I have script that generates child WT.Earlier its CreaAnd LInk method is called and then assigning title and other values to child WT. When I make few fields mandatory on first save. child is not getting created.I guess may be because createAndLink failing. Is ther way /method I can pass mandatory field values, work item type, to create WTand then link to parent? This has to be in process configuration source code. This is what I have currently.
if(childWT== null ){
Thanks, Kavita Kavita,
|
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.