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

Delete change sets in DNG via API

 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?

0 votes


Accepted answer

Permanent link

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

0 votes

Comments

 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.

Then, please accept the answer. 

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 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,978

Question asked: Mar 25 '24, 5:30 a.m.

Question was seen: 457 times

Last updated: Mar 25 '24, 8:58 a.m.

Confirmation Cancel Confirm