create a macro that produces an editable table/content

I would like a macro that will create in the editor a table that is edited directly without (re)setting the macro parameters. I would like to have behave it more like a template functionality that a 'macro'.

For example: As a user I want to insert a properties table with a page status that is rendered in the editor in the 'body' of the macro and edited directly without setting the parameters. Like the color of the status block.

The following code is what I have so far using parameters. It renders a properties table in a viewable page, but renders just a 'macro' block in the editor and if I need to update the 'status' I need to change the macro parameters.

I would like to know if it is possible to 'set' the $body of the macro to the 'html' included in the macro below the parameters definitions.

## Macro title: Owner and Approved properties table
## Macro has a body: N
## Body processing: -
## Output: -
##
## Developed by: @jochem.berends
## Date created: 10-06-2013
## Installed by: @jochem.berends

## @param Owner:title=Owner|type=username|required=true|desc=The Owner of this Page
## @param Status:title=Status|type=enum|enumValues=For Reference,In Work,Prepared,Approved,Released|desc=Choose the status of the page|default=In Work
## @param Approval:title=Approval|type=username|desc=Enter the name who need to approve this page
## @param ReleasedBy:title=Released By|type=username|desc=Enter the name who need to release this page
## @param ReleaseDate:title=Release Date|type=date|desc=Enter release date in format dd-mm-YYYY

<ac:macro ac:name="details"><ac:parameter ac:name="label">Status</ac:parameter>
	<ac:rich-text-body>
		<table>
			<tbody>
				<tr>
					<th>Page Status</th>
					<td colspan="1"><ac:macro ac:name="status"><ac:parameter ac:name="colour">Green</ac:parameter><ac:parameter ac:name="title">$paramStatus</ac:parameter></ac:macro></td></tr>
				<tr>
					<th>Owner</th>
					<td colspan="1">
						<p><ac:link><ri:user ri:username="$!paramOwner" /></ac:link></p></td></tr>
				<tr>
					<th colspan="1">Approval By</th>
					<td colspan="1">
						<ac:task-list>
							<ac:task>
								<ac:task-id>1</ac:task-id>
								<ac:task-status>incomplete</ac:task-status>
								<ac:task-body><ac:link><ri:user ri:username="$!paramApproval" /></ac:link></ac:task-body>
							</ac:task>
						</ac:task-list>
					</td></tr>
				<tr>
					<th colspan="1">Release By</th>
					<td colspan="1">
						<ac:task-list>
							<ac:task>
								<ac:task-id>1</ac:task-id>
								<ac:task-status>incomplete</ac:task-status>
								<ac:task-body><ac:link><ri:user ri:username="$!paramReleasedBy" /></ac:link></ac:task-body>
							</ac:task>
						</ac:task-list>
					</td></tr>
				<tr>
					<th>Issue Number</th>
					<td colspan="1">
						<p>1</p></td></tr>
				<tr>
					<th colspan="1">Date of Release</th>
					<td colspan="1">$!paramReleaseDate</td>
				</tr>
			</tbody>
		</table>
	</ac:rich-text-body>
</ac:macro>

1 answer

1 accepted

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
Published Thursday in Jira Service Desk

How the Telegram Integration for Jira helps Sergey's team take their support efficiency to the bank

...+ reading Fantasy). The same is true for him at the bank he works for: Efficiency is key when time literally equals money. Read on to learn how Sergey makes most of the time he has by...

403 views 2 4
Read article

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