Jquery to delete a specified label from confluence

Please help anyone to write Jquery function to delete a specified label from confluence

6 answers

1 accepted

Thanks Stephen. I have tried the following and its working well

jQuery.post(contextPath+"/json/removelabelactivity.action", {"entityIdString": "$content.id", "labelIdString": jQuery(this).val(), "atl_token": jQuery("#atlassian-token").attr("content") } ,function(){

alert("label removed from page");
});

Dinoj

Dinoj,

What are you trying to accomplish? Hide/remove a label from a page? Or are you trying to delete it from the labels list? In either case, I am not really sure jQuery is the right answer. Maybe you are trying to do something else that I am not aware of?

Hi Matthew,

What I trying to do is that I will generate some list of names with checkbox options. the selected label would be added if I check the box and delete the label if uncheck the box.

For adding , I got some idea from https://answers.atlassian.com/questions/22344/how-do-i-add-labels-to-a-page-using-a-user-macro

It would be great if you help to delete in the same way..

Thanks Matthew for your comments.

Cheers!

Dinoj

Hi Matthew,

What I trying to do is that I will generate some list of names with checkbox options. the selected label would be added if I check the box and delete the label if uncheck the box.

For adding , I got some idea from https://answers.atlassian.com/questions/22344/how-do-i-add-labels-to-a-page-using-a-user-macro

It would be great if you help to delete in the same way..

Thanks Matthew for your comments.

Cheers!

Dinoj

Hello,

If some one have some idea, let me know..please..

Thanks..

Hi Dinoj,

I don't really have time to write it for you, but if you just want to know how it's done, you can check out this code snippet:

http://pastebin.com/c58hZssb

Basically, instead of "addlabelactivity.action", you need to use "removelabelactivity.action". Hope that helps!

Stephen

Thank Stephen...will try and let you know..

Cheers

Dinoj

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

866 views 23 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you