Skip to content

Commit e595223

Browse files
committed
Assets: Add example to delete object
1 parent 61373cc commit e595223

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
File renamed without changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from atlassian import Assets
2+
import pandas as pd
3+
4+
5+
def delete_object(ins, object_id):
6+
try:
7+
ins.delete_object(object_id)
8+
print(f"Object with ID {object_id} deleted successfully.")
9+
except Exception as e:
10+
print(f"Failed to delete object with ID {object_id}: {e}")
11+
12+
13+
if __name__ == "__main__":
14+
ins = Assets(url="https://jira.example.com", username="admin",
15+
token="--------------------------------", cloud=False)
16+
17+
df = pd.read_csv('diff.csv')
18+
df['Internal Object ID'].drop_duplicates().apply(lambda x: delete_object(ins, x))
File renamed without changes.

0 commit comments

Comments
 (0)