@@ -145,8 +145,8 @@ def delete_whiteboard_example(whiteboard_id):
145
145
print (f"\n === Deleting whiteboard (ID: { whiteboard_id } ) ===" )
146
146
147
147
try :
148
- result = confluence .delete_whiteboard (whiteboard_id )
149
- print (f"Whiteboard deleted successfully " )
148
+ confluence .delete_whiteboard (whiteboard_id )
149
+ print (f"Deleted whiteboard { whiteboard_id } " )
150
150
return True
151
151
152
152
except Exception as e :
@@ -267,7 +267,7 @@ def update_custom_content_example(custom_content_id, title, body, content_type,
267
267
type = content_type ,
268
268
title = title ,
269
269
body = body ,
270
- version_number = version_number ,
270
+ version_number = current_version + 1 ,
271
271
status = "current" ,
272
272
version_message = "Updated via API example"
273
273
)
@@ -293,7 +293,7 @@ def custom_content_labels_example(custom_content_id):
293
293
# Add a label to the custom content
294
294
label = "example-label"
295
295
print (f"Adding label '{ label } ' to custom content" )
296
- added_label = confluence .add_custom_content_label (
296
+ confluence .add_custom_content_label (
297
297
custom_content_id = custom_content_id ,
298
298
label = label
299
299
)
@@ -344,7 +344,7 @@ def custom_content_properties_example(custom_content_id):
344
344
}
345
345
346
346
print (f"Creating property '{ property_key } ' for custom content" )
347
- created_prop = confluence .create_custom_content_property (
347
+ confluence .create_custom_content_property (
348
348
custom_content_id = custom_content_id ,
349
349
key = property_key ,
350
350
value = property_value
@@ -362,7 +362,7 @@ def custom_content_properties_example(custom_content_id):
362
362
updated_value ["description" ] = "This is an updated description"
363
363
364
364
print (f"Updating property '{ property_key } '" )
365
- updated_prop = confluence .update_custom_content_property (
365
+ confluence .update_custom_content_property (
366
366
custom_content_id = custom_content_id ,
367
367
key = property_key ,
368
368
value = updated_value ,
@@ -456,8 +456,9 @@ def delete_custom_content_example(custom_content_id):
456
456
print (f"\n === Deleting custom content (ID: { custom_content_id } ) ===" )
457
457
458
458
try :
459
- result = confluence .delete_custom_content (custom_content_id )
460
- print (f"Custom content deleted successfully" )
459
+ print (f"Deleting custom content with ID: { custom_content_id } " )
460
+ confluence .delete_custom_content (custom_content_id )
461
+ print (f"Custom content successfully deleted" )
461
462
return True
462
463
463
464
except Exception as e :
@@ -525,4 +526,58 @@ def delete_custom_content_example(custom_content_id):
525
526
# ancestors = get_custom_content_ancestors_example(custom_content_id)
526
527
527
528
# Delete custom content
528
- # delete_custom_content_example(custom_content_id)
529
+ # delete_custom_content_example(custom_content_id)
530
+
531
+ # Delete whiteboards
532
+ print ("\n Deleting nested whiteboard..." )
533
+ confluence .delete_whiteboard (whiteboard_id )
534
+ print ("Nested whiteboard deleted" )
535
+
536
+ print ("\n Deleting parent whiteboard..." )
537
+ confluence .delete_whiteboard (whiteboard_id )
538
+ print ("Parent whiteboard deleted" )
539
+
540
+ # Update custom content
541
+ print ("\n Updating custom content..." )
542
+ updated_content = confluence .update_custom_content (
543
+ custom_content_id = custom_content_id ,
544
+ type = "my.custom.type" ,
545
+ title = "Updated Custom Content" ,
546
+ body = "<p>This content has been updated via API</p>" ,
547
+ status = "current" ,
548
+ version_number = current .get ("version" , {}).get ("number" , 1 ) + 1 ,
549
+ space_id = space_id ,
550
+ body_format = "storage"
551
+ )
552
+
553
+ # Add labels to custom content
554
+ print ("\n Adding labels to custom content..." )
555
+ confluence .add_custom_content_label (
556
+ custom_content_id = custom_content_id ,
557
+ label = "api-example"
558
+ )
559
+
560
+ # Create property
561
+ confluence .create_custom_content_property (
562
+ custom_content_id = custom_content_id ,
563
+ key = property_key ,
564
+ value = property_data
565
+ )
566
+
567
+ # Update property
568
+ print ("\n Updating property..." )
569
+ property_data ["color" ] = "red"
570
+
571
+ confluence .update_custom_content_property (
572
+ custom_content_id = custom_content_id ,
573
+ key = property_key ,
574
+ value = property_data ,
575
+ version_number = property_details ['version' ]['number' ] + 1
576
+ )
577
+
578
+ # Clean up - delete custom content
579
+ print ("\n Deleting custom content..." )
580
+ confluence .delete_custom_content (custom_content_id )
581
+ print (f"Deleted custom content { custom_content_id } " )
582
+
583
+ return True
0 commit comments