No web service for deleting a work item?

Description
sboucard@sodius.com
Posts: 2
Joined: Mon Mar 12, 2018 10:50 am

No web service for deleting a work item?

Postby sboucard@sodius.com » Mon Mar 12, 2018 10:57 am

Hello,
I connect to Polarion using web services to create/update/read/delete data.
This is realized through APIS provided by com.polarion.alm.ws.client.tracker.TrackerWebService.
However I doesn't seem to find any deleteWorkItem(uri) method in there.
Is it intended not to expose such API? Or did I missed this functionality defined somewhere else?
Many thanks,
Sebastien

Jürgen
Posts: 43
Joined: Tue Sep 12, 2017 1:02 pm

Re: No web service for deleting a work item?

Postby Jürgen » Tue Mar 13, 2018 10:21 am

As far as I know, the interface IWorkItem has a delete method.

ALMighty
Posts: 80
Joined: Wed Apr 27, 2016 10:34 am
Location: Austria

Re: No web service for deleting a work item?

Postby ALMighty » Wed Mar 14, 2018 11:51 am

sboucard@sodius.com wrote:However I doesn't seem to find any deleteWorkItem(uri) method in there.
Is it intended not to expose such API? Or did I missed this functionality defined somewhere else?


You are using the SOAP API via Java, right? I am asking because there is the possibility to invoke the API via C# but I am not sure if functions/methods are differing in contrast to Java (e.g. I had to experience humbly that no Getter methods are available when using the API via C#).

However concerning Java: As far as I see it, there is no method available to delete work items, neither in TrackerWebService nor in the other service classes.

Edit: I think this is intended by the Developers, because if you compare the IProjectService class (which is for Wikipages) and the ProjectWebService, you clearly see that deleting users is also only possible in Wikipages but not in a Java App via the API.

Jürgen wrote:As far as I know, the interface IWorkItem has a delete method.


You mixed things up but that happened to me also because how the Polarion developers named the classes for the WikiPages and the SOAP API is a bit confusing. IWorkItem is the class which is used in Wikipages (which has a delete method), most of the time is it is used on conjunction with the ITrackerService class.

For the SOAP API, if the author of this topic/thread uses Java (I am not sure concerning C#), the corresponding class of work item instances is WorkItem, the counterpart for the trackerservice is TrackerWebService which can be generated through the WebServiceFactory class.

Edit: I just found this thread, which shows that not only we two had this misconception that IWikipage can be used via the API: viewtopic.php?t=20242
---------------------------------------------------------------------------------------------------
Playing a good game is never lame. :D
Image

sboucard@sodius.com
Posts: 2
Joined: Mon Mar 12, 2018 10:50 am

Re: No web service for deleting a work item?

Postby sboucard@sodius.com » Wed Mar 14, 2018 4:22 pm

Thanks for the detailed answer.
Indeed I use SOAP API and the TrackerWebService class. I have the requirement to connect to a Polarion server from client side and don't have the possibility to run my code embedded in Polarion in any way. I understand SOAP is the right (only?) applicable technology for such case.
My understanding is that the IWorkItem class is not applicable to SOAP and I cannot use it in my deployment scheme.
So I guess my original understanding was right: I have no mean through SOAP to delete a work item. Which is a killer for me, as I have a very valid use case having to do such thing.

ALMighty
Posts: 80
Joined: Wed Apr 27, 2016 10:34 am
Location: Austria

Re: No web service for deleting a work item?

Postby ALMighty » Thu Mar 15, 2018 11:51 am

sboucard@sodius.com wrote:I have no mean through SOAP to delete a work item. Which is a killer for me, as I have a very valid use case having to do such thing.



I know it is frustrating that no WorkItem delete function/method is available. :cry: Maybe the intention of the Polarion developers was to restrict deleting because it is likely to wreck up database consistency and rather mark them with a "Cancelled" status (or any status you like) "Invalid" or "Redundant" in the resolution field (or any resolution which fits best to your needs).

However maybe this work around is a solution for you: You could create a customfield "to_delete" and instead of deleting the work item in your Java programme, you fill a value into this field. Then ( you can go the Polarion Web UI (you go there manually, no script involved anymore), proceed to the Work Items browser and query for all the work items which have a certain value in the "to_delete" field which qualifies them for deleting. Then you can bulk select (in the attached picture below you can see how it is done) all these items with one click and then delete these items with one just another click. :D

(EDIT1:) Setting a custom field can be either done by 1. triggering setCustomFields() and then updateWorkItem() or 2. invoking just setCustomField() which does not need updateWorkItem because it triggers the update to SVN and Polarion directly.

(EDIT2) Alternative to my work around: You can create a wikipage which loads all the work items which have to be deleted based on a query and then it deletes all the items in a foreach loop. The wikipage is executed each time you click on it, so when you have the page ready you have to do less clicks then in the actual work around. :lol:
Attachments
How_to_bulk_edit.png
How to use the bulk select/bulk edit option Polarion for deleting many work items.
How_to_bulk_edit.png (189.12 KiB) Viewed 1491 times
---------------------------------------------------------------------------------------------------
Playing a good game is never lame. :D
Image

Jürgen
Posts: 43
Joined: Tue Sep 12, 2017 1:02 pm

Re: No web service for deleting a work item?

Postby Jürgen » Thu Mar 15, 2018 3:00 pm

Thanks for clarification, ALMighty

In fact there is a whole bunch of workarounds possible, e.g. moving those items into a specific document, or creating a work item type "deleted" and then change the type to this.

Unfortunately none of these workarounds really works when using queries for work items, because those items will always be found if they are not explicitly filtered out. Best way probably is to "resolve" them somehow, so the "unresolved" filter applies, which is the easiest to use.


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 8 guests