Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I write scaffolding macro data into parameters via Rest API?

Can anyone help me with this? I already found out a way how to write into these macros but I dont get how to read from them.  This is how to write into the macros. (Using the Scaffolding REST API with ScriptRunner for Confluence - Scaffolding Forms & Templates (servicerocket.com))

1 answer

1 accepted

Hi Lennard,

Please allow me to answer your queries.

Before we proceed, may I know whether the use of ScriptRunner is required at the moment? As if we would like to write the structure of the REST API, we can follow this article instead as a starter:

First, we can get the Scaffolding form structure by using the mentioned GET method. Below is an example of my form retrieved using the GET method where there are 2 Text Data's, a List Data with its options, and a Date Data.

[
{
"macro": "text-data",
"macroId": "c7429ed3-ba43-4184-ace4-9ae674ec16d4",
"name": "project",
"type": "line",
"content": "text",
"required": false
},
{
"macro": "text-data",
"macroId": "bf98ed11-ae67-4610-9c2c-e5da6f6c9d79",
"name": "desc",
"required": false
},
{
"macro": "list-data",
"macroId": "c74210a0-73bc-4248-ab06-79e94a78756c",
"name": "status",
"multiple": false,
"options": [
{
"value": "Open",
"option": "list-option"
},
{
"value": "In Progress",
"option": "list-option"
},
{
"value": "Done",
"option": "list-option"
}
],
"required": false
},
{
"macro": "date-data",
"macroId": "479a905f-0816-4e5c-b83b-0970ec43d1bf",
"name": "due",
"required": false
}
]

As we get the form structure through the GET method, we can follow it to write the Body for the PUT method. Following the article, we can set the values below:

[
{
"macro": "text-data",
"name": "project",
"value": "Project Alpha"
},
{
"macro": "text-data",
"name": "desc",
"value": "This is the test project"
},
{
"macro": "list-data",
"name": "status",
"value": ["In Progress"]
},
{
"macro": "date-data",
"name": "due",
"value": "2022-04-02 11:11:11"
}
]

 Run the PUT request with the above JSON body including the "Content-Type: application/json" header, the form will be updated with the value set above. To help with the test, I'm using the Postman app.

In case that we misunderstand your queries or if you have any further questions, feel free to raise a ticket in our portal through the link below:
- https://servicerocket-apps.atlassian.net/servicedesk/customer/portal/1

Best Regards,
Julian.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Staying organized with Jira: best practices for a better project management

Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...

242 views 2 1
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you