It's all about the answers!

Ask a question

Delete change sets in DNG via API


Antje Rößle-Tuchel (293) | asked Mar 25, 5:30 a.m.

 I create via API change sets for DNG. In certain cases I want to delete them. I have tried: 


let deleteChangeSet = await fetch(changeSetUri,{
        method: "DELETE",
        headers: {"Accept":"application/json",
        "OSLC-Core-Version": "2.0"}
        }
    )
    let jsonResponse = deleteChangeSet.status

The response is, that I have not the rights to do so? So I am asking,
if the possibility to delete change sets exists via API?

Accepted answer


permanent link
Ralph Schoon (63.2k33646) | answered Mar 25, 7:23 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You can discard a change set in the UI. So there is an, probably internal, API to do it. I have looked at this years ago, see this statement: https://jazz.net/library/article/92596#whatAPIandHow . It states that discarding a change set is supported, but not documented. Maybe you create an idea to get this documented?


Your description of the error message is insufficient to do anything with it.

In my mind, the delete method is the correct one to use. The type system manager (I shared the link already) implements the delete here: https://github.com/jazz-community/dng-type-system-management/blob/master/com.ibm.rm.typemanagement/src/main/java/com/ibm/requirement/typemanagement/oslc/client/dngcm/DngCmUtil.java#L623

It is not an OSLC operation as far as I can tell.

I would suggest to 
  • Omit the OSLC Header 
  • Omit the Accept
I do not seem to send these headers. Hard to tell without actually debugging it.

Here the documentation for the UI: https://www.ibm.com/docs/en/engineering-lifecycle-management-suite/doors-next/7.0.3?topic=artifacts-discarding-change-sets . It mentions permissions, but I do not see a dedicated permission for deleting.

Antje Rößle-Tuchel selected this answer as the correct answer

Comments
Antje Rößle-Tuchel commented Mar 25, 8:24 a.m. | edited Mar 25, 8:31 a.m.

 Dear Ralph,


thank you for your answer. Deleting the two headers work fine. Thank you for this hint.

So the request looks very simple:


The respond is 200 OK.


Ralph Schoon commented Mar 25, 8:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Then, please accept the answer. 


Ralph Schoon commented Mar 25, 8:56 a.m. | edited Mar 25, 8:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I would suggest you look at the location header of the response. If the response sends a tracker URL, it is a long running operation. This is the case for deliver, for example. 
Check the documentation of  the deliver operation in the server API. Also see the task tracker API. https://jazz.net/wiki/bin/view/Main/DNGServerAPI

Your answer


Register or 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.