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

How do I create a user macro that adds a label to the page it is used on?

Rachel Sienko January 6, 2016

This question is in reference to Atlassian Documentation: Adding, Editing and Removing User Macros

Ask your question here...

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2016

The easiest way I know of is to use Javascript:

<script>
AJS.toInit(function() {
  jQuery.post(contextPath+'/json/addlabelactivity.action', {'entityIdString': '$content.id', 'labelString': 'label-to-add', 'atl_token': jQuery('#atlassian-token').attr('content');
});
<script>
0 votes
Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2016

I am curious why you would want to do this with a user macro ... as you have to edit the page to add the macro and it would be just as easy(easier, since you don't have to go into edit mode) to simply add a label.

Melissa C August 2, 2017

Hello Davin,

I know it sounds silly - I'm already asking my users to enter a document number that we use internally. I wanted to use that number and add it as a label . So what we can search by label

Melissa C November 3, 2017

@Davin Studer @Stephen Deutsch

Any ideas how I can so this?

I've posted this question in a number of threads and can't get an answer.  Any help would be appreciated 

Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2017

Hi @Melissa C,

I see from another question's comments that you are having your users enter the document number using a user macro. Perhaps if you posted the user macro then we could help you adapt it so that it adds a label as well. However, this would be better submitted as a separate question instead of a comment on an existing thread.

Melissa C November 3, 2017

Thanks will do @Stephen Deutsch

TAGS
AUG Leaders

Atlassian Community Events