Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How to delete the deployment info sent using Jenkins integration (jiraSendDeploymentInfo)

I have configured my Jenkins pipeline to send the deployment info using jiraSendDeploymentInfo including environment and site ID which is working as expected.

How can I delete deployment info from Jira which has incorrect information? Is there any way to revert the deployment info sent by Jenkins using jiraSendDeploymentInfo and published under Jira deployments?

1 answer

0 votes
Mark Rekveld - Marvelution
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Oct 06, 2023

Hi @Chandrapratap Singh 

Welcome to the community.

Deployments that are added to Jira can be deleted using 2 REST APIs namely Delete By Properties and Delete By Key 

However as far as I can make out the plugin that you install in Jenkins doesn't support either API for deleting deployments, so you will need to implement some custom code to reuse the configuration of the plugin so you can make authenticated requests to delete the deployments.

Cheers,
Mark

Hi @Mark Rekveld - Marvelution I have tried to use the Delete By Properties API but it's not working.

I have followed this doc and generated the bearer token:

https://developer.atlassian.com/cloud/jira/software/integrate-jsw-cloud-with-onpremises-tools/

Here is what my curl request looks like:

curl --request DELETE \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--url 'https://api.atlassian.com/jira/deployments/0.1/cloud/{cloudId}/bulkByProperties?environmentId=DEV-CANADA'
curl --request DELETE \
--header 'Accept: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--url 'https://cloudbolt.atlassian.net/rest/deployments/0.1/bulkByProperties?environmentId=DEV-CANADA'

I have tried to use both the URLs as suggested in this doc:

https://developer.atlassian.com/cloud/jira/software/rest/intro/#base-url-differences


But getting the following errors for both API calls respectively:

{"code":401,"message":"Unauthorized"}
{"message":"Client must be authenticated to access this resource.","status-code":401}

Can you please help me in resolving these errors?

Mark Rekveld - Marvelution
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Oct 21, 2023

Hi @Chandrapratap Singh 

The Delete By Properties API can only delete deployments using the properties that where set when the deployment was send to Jira using the Submit Deployment API 

I'm not sure if one account can delete deployments that another account has added, this would be something to check with Atlassian. Maybe through a support ticket if no response come here.

As for the 401, it is likely that either the provided authentication header was not identified by the API endpoint or that the token provided was not identified and that the request was treated as an anonymous requests. I would suggest double checking the process of getting the access token.

Cheers,
Mark

Hi @Mark Rekveld - Marvelution 

 

Thanks for your response.

FYI, the deployments are sent to Jira using the Jira-Jenkins integration. 

https://support.atlassian.com/jira-cloud-administration/docs/integrate-with-jenkins/ 


Thanks,

Chandrapratap Singh

Mark Rekveld - Marvelution
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Oct 26, 2023

I'm not sure how I can help you further, but maybe @Tom Hombergs can help you, looking at the commit log of the plugin and this article he seems to be one of the developers of the plugin.

@Tom Hombergs Can you please provide any solution to delete the deployment created via the Jenkins-Jira integration app? 

I got to know that the Jira-Jenkins integration app is a Forge connect app and the only way is to delete the app to remove the deployment data but this approach will delete all the deployments added by the app.

Any turnaround to delete specific deployments?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events